PC Review


Reply
Thread Tools Rate Thread

DataView IndexOf

 
 
=?Utf-8?B?cmFuZHkxMjAw?=
Guest
Posts: n/a
 
      21st Jun 2006
I have a CustomerTable which is a DataTable.
I have a PersonalDataView which is a DataView.

The code below returns the row index of the table beautifully.
Any pointers on how to get the row index of the DataView?

Thanks,
Randy


DataRow dr = CustomerTable.Rows.Find(CustomerId);

if(dr != null)
{
positionIndex = CustomerTable.Rows.IndexOf(dr);

//How do I modify the following line to get the IndexOf the
DataView
//int viewIndex =
((IList<DataView>)PersonalDataView).IndexOf(dr);
}

 
Reply With Quote
 
 
 
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      22nd Jun 2006
Hi Randy,

Thank you for posting.

You can use the following statement to get the index of a row from the
DataView.
positionIndex = PersonalDataView.Table.Rows.IndexOf(dr);

If you have any thing unclear, please don't hesitate to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted DataView, but unsorted datalist when bound to the dataview CodeMonkey Microsoft ASP .NET 1 4th Feb 2011 10:55 AM
to find the data from one dataview not in another dataview joe Microsoft ADO .NET 0 9th Jul 2008 10:39 AM
DataView - How to access the row in the datatable behind the DataView Richard Microsoft VB .NET 5 17th Jul 2005 04:57 PM
Is there an easy way to copy a DataView (or even the DataGrid showing the DataView) to the Clipboard? Kevin Brown Microsoft Dot NET 4 5th Jan 2005 09:01 PM
DataView.AddNew and DataView.Count =?Utf-8?B?c3VidA==?= Microsoft ADO .NET 5 21st Mar 2004 05:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 PM.