how to get datagrid item index from DataKeyField value?

Discussion in 'ASP .Net Datagrid Control' started by Sean, Aug 6, 2003.

  1. Sean

    Sean Guest

    Can I not use loop? Is it a simple way to do it? Thanks.
    Sean, Aug 6, 2003
    #1
    1. Advertising

  2. Sean

    Arthur Guest

    set your datakey field--> DataKeyField="ID"

    Dim ID As Integer = DataGrid1.DataKeys(e.Item.ItemIndex)

    will place the itemIndex (in this case the ID) into a
    variable with the same name

    Arthur

    >-----Original Message-----
    >Can I not use loop? Is it a simple way to do it? Thanks.
    >
    >
    >.
    >
    Arthur, Aug 7, 2003
    #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,104
    Suresh
    Mar 5, 2004
  2. Adam Knight

    DataGrid - DataKeyField!!

    Adam Knight, Aug 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    4,180
    Adam Knight
    Aug 7, 2005
  3. A. Atienza

    DataGrid's DataKeyField Value (C#)

    A. Atienza, Dec 7, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    333
    Michael Tkachev
    Dec 7, 2004
  4. Stephen Woolhead

    Datagrid DataKeyField and Webservice Proxy Objects

    Stephen Woolhead, Dec 16, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    155
    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:
    459
    Brock Allen
    May 31, 2005
Loading...

Share This Page