Saturday, March 24, 2012

Loop through textboxes in a gridview

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.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Steve" <bahram@.iranmania.comwrote in message
news:1153920943.022819.201710@.i42g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

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.
>


Could you please give me an example of the syntax to be used?

Eliyahu Goldin wrote:

Quote:

Originally Posted by

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" <bahram@.iranmania.comwrote in message
news:1153920943.022819.201710@.i42g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

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.

0 comments:

Post a Comment