![]() |
Needed: Index to a selected DataView row
Hi,
I've got a DataGrid bound to a DataView that is sorted. ("Aha!", I hear you saying.) When I go to EditMode 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! |
Re: Needed: Index to a selected DataView row
just
((DataRowView)Container.Item.DataItem).Row "Paul" <nospampaulleblanc49@msn.com> ???? news:u$VKwocvDHA.2448@TK2MSFTNGP09.phx.gbl... > Hi, > I've got a DataGrid bound to a DataView that is sorted. ("Aha!", I hear > you saying.) > > When I go to EditMode 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! |
Re: Needed: Index to a selected DataView row
also you can yse e.Item.DataSetIndex
"Paul" <nospampaulleblanc49@msn.com> ???? news:u$VKwocvDHA.2448@TK2MSFTNGP09.phx.gbl... > Hi, > I've got a DataGrid bound to a DataView that is sorted. ("Aha!", I hear > you saying.) > > When I go to EditMode 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! |
Re: Needed: Index to a selected DataView row
Thanks, I'm working with it (having some problems) but the DataViewRow object looks very promising. ~P *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
| All times are GMT. The time now is 11:01 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.