Datav

Discussion in 'ASP .Net Datagrid Control' started by Paul, Dec 8, 2003.

  1. Paul

    Paul Guest

    Hi,
    I've got a DataGrid bound to a DataView that is sorted. ("Aha!", I hear
    you saying.)

    When I go to EditMode on the grid I get the right DataRow, but I get the
    wrong index from e.item.itemindex (of course.) Therefore, what I'm
    doing pretty much sucks as the Update updates the wrong record.

    How do I get the index of the selected item in a DataView? I get the
    results I want by hardcoding the index like this:

    DataRow1 = DataView1.Table.Rows(10)

    Thanks for your help, I've been searching in Google and MSDN for days
    with no luck. ~P



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Paul, Dec 8, 2003
    #1
    1. Advertising

  2. > "Paul" wrote:
    > I've got a DataGrid bound to a DataView that is sorted. ("Aha!", I hear
    > you saying.)
    > When I go to EditMode on the grid I get the right DataRow, but I get the
    > wrong index from e.item.itemindex (of course.) Therefore, what I'm
    > doing pretty much sucks as the Update updates the wrong record.
    >
    > How do I get the index of the selected item in a DataView? I get the
    > results I want by hardcoding the index like this:
    >
    > DataRow1 = DataView1.Table.Rows(10)



    Would DataGrid.CurrentCell.RowNumber() work?
    Steve Landess, Dec 12, 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.

Share This Page