Get the row that an object is contained in

Discussion in 'ASP .Net' started by =?Utf-8?B?bXdoYWxlbg==?=, Feb 1, 2005.

  1. Hello all,

    I have a datagrid that I dynamically add rows to (through binding to a
    datatable). Each row has a textbox that a user can enter a value into and a
    couple of other columns with values.

    I have the textbox autopostback set to true so that I can capture the text
    changed event. What I need to do in that event is get data from another
    column in the same row as the textbox that was changed, but I'm not sure how
    I know or how I would find out what the row is.

    I've accessed the entered value of the textbox through the sender, but now
    what?

    TIA,
    Melissa
    --
    Thanks
    =?Utf-8?B?bXdoYWxlbg==?=, Feb 1, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?bXdoYWxlbg==?=

    Axel Dahmen Guest

    I'd check the ClientID or UniqueID of the sender control. Maybe this may
    give you some ideas.
    BTW, how did you create the textboxes? Did you use <asp:TemplateColumn>? In
    that case you might want to preset the textboxes's IDs using ID='<%#
    "txt"+DataBinder.Eval(Container.DataItem,....)%>'. This way you can easily
    identify the row later using source.ID.SubString(3).

    HTH,
    Axel Dahmen
    --
    www.sportbootcharter.com
    ---------------------
    "mwhalen" <> schrieb im Newsbeitrag
    news:...
    > Hello all,
    >
    > I have a datagrid that I dynamically add rows to (through binding to a
    > datatable). Each row has a textbox that a user can enter a value into and

    a
    > couple of other columns with values.
    >
    > I have the textbox autopostback set to true so that I can capture the text
    > changed event. What I need to do in that event is get data from another
    > column in the same row as the textbox that was changed, but I'm not sure

    how
    > I know or how I would find out what the row is.
    >
    > I've accessed the entered value of the textbox through the sender, but now
    > what?
    >
    > TIA,
    > Melissa
    > --
    > Thanks
    Axel Dahmen, Feb 1, 2005
    #2
    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. Adam Hartshorne
    Replies:
    1
    Views:
    349
    Victor Bazarov
    Mar 3, 2005
  2. morz
    Replies:
    5
    Views:
    339
  3. Smith
    Replies:
    0
    Views:
    1,522
    Smith
    Oct 21, 2009
  4. D
    Replies:
    0
    Views:
    199
  5. Replies:
    1
    Views:
    127
Loading...

Share This Page