DataGrid's DataKeyField Value (C#)

Discussion in 'ASP .Net Datagrid Control' started by A. Atienza, Dec 7, 2004.

  1. A. Atienza

    A. Atienza Guest

    Hi all,

    I have a DataGrid control (parent) and a Repeater control (child) in my
    webform. In my Repeater_ItemDataBound event, I would like to get the value
    of the current DataGrid row's DataKeyField. How can I do this?

    Thank you for any help you can provide.

    Arlynn
     
    A. Atienza, Dec 7, 2004
    #1
    1. Advertising

  2. Hi,

    Repeater r =
    (Repeater)e.Item.Cells[0].Controls.FindControl("RepeaterControlID");
    object o = r.Items.SelectedItem;

    Something like this... :)

    bye

    Mike

    "A. Atienza" <> wrote in message
    news:%23jDlV9$...
    > Hi all,
    >
    > I have a DataGrid control (parent) and a Repeater control (child) in my
    > webform. In my Repeater_ItemDataBound event, I would like to get the

    value
    > of the current DataGrid row's DataKeyField. How can I do this?
    >
    > Thank you for any help you can provide.
    >
    > Arlynn
    >
    >
     
    Michael Tkachev, Dec 7, 2004
    #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. Homer J. Simpson
    Replies:
    2
    Views:
    1,120
    Suresh
    Mar 5, 2004
  2. Adam Knight

    DataGrid - DataKeyField!!

    Adam Knight, Aug 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    4,211
    Adam Knight
    Aug 7, 2005
  3. Sean

    how to get datagrid item index from DataKeyField value?

    Sean, Aug 6, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    833
    Arthur
    Aug 7, 2003
  4. Stephen Woolhead

    Datagrid DataKeyField and Webservice Proxy Objects

    Stephen Woolhead, Dec 16, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    168
    Stephen Woolhead
    Dec 20, 2004
  5. Kylin

    How to get the DataKeyField in the DataGrid ?

    Kylin, May 31, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    485
    Brock Allen
    May 31, 2005
Loading...

Share This Page