Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   Needed: Index to a selected DataView row (http://www.velocityreviews.com/forums/t759987-needed-index-to-a-selected-dataview-row.html)

Paul 12-08-2003 08:30 PM

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!

lostinet 12-09-2003 03:03 AM

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!




lostinet 12-09-2003 03:09 AM

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!




Paul 12-09-2003 06:11 AM

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 01:47 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.