Datav

P

Paul

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
 
S

Steve Landess

Paul said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top