Loop through textboxes in a gridview

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

One of the columns in my gridview is a blank textbox (I have added it
as a template field). Users can enter a number in the textbox for a
multiple of the gridview records.

I have a submit button which is intended to use code behind to access
these textbox values and eventually add them to a database.

However, I can't seem to loop through the textboxes in the gridview
successfully and store their values. Does anyone know the right syntax
for accessing these textbox values using a For and Next statement?

Thank you.
 
Loop through the gridview Rows collection. For every row find the textbox
with FindConrol method.
 
Could you please give me an example of the syntax to be used?


Eliyahu said:
Loop through the gridview Rows collection. For every row find the textbox
with FindConrol method.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Steve said:
One of the columns in my gridview is a blank textbox (I have added it
as a template field). Users can enter a number in the textbox for a
multiple of the gridview records.

I have a submit button which is intended to use code behind to access
these textbox values and eventually add them to a database.

However, I can't seem to loop through the textboxes in the gridview
successfully and store their values. Does anyone know the right syntax
for accessing these textbox values using a For and Next statement?

Thank you.
 
Back
Top