Loop through textboxes in a gridview

Discussion in 'ASP .Net' started by Steve, Jul 26, 2006.

  1. Steve

    Steve Guest

    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.
    Steve, Jul 26, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
    >
    Eliyahu Goldin, Jul 26, 2006
    #2
    1. Advertising

  3. Steve

    Steve Guest

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


    Eliyahu Goldin wrote:
    > 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" <> wrote in message
    > news:...
    > > 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.
    > >
    Steve, Jul 29, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason

    Loop Through Textboxes

    Jason, Dec 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    6,298
    Jason
    Dec 11, 2003
  2. VB Programmer

    How to loop thru all textboxes on form?

    VB Programmer, Jan 4, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    6,001
    Saravana
    Jan 4, 2005
  3. Paul D. Fox
    Replies:
    6
    Views:
    18,987
    =?Utf-8?B?bWlrZQ==?=
    May 22, 2005
  4. Roedy Green
    Replies:
    3
    Views:
    415
    Mike Schilling
    Sep 13, 2008
  5. Isaac Won
    Replies:
    9
    Views:
    354
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page