PC Review


Reply
Thread Tools Rate Thread

DataView Bug?

 
 
Brian Nantz
Guest
Posts: n/a
 
      25th Mar 2004
I ran into this toady and I can't figure it out. Here is the code:

System.Guid guid = this.dsLoop.Device[this.cbDomainPanels.SelectedIndex].ID;

//This doesn't filetr correctly
// DataView dv = new DataView(this.dsPanel.Device, "[Parent]='" +
guid.ToString() + "'", "", DataViewRowState.CurrentRows);

//This filters just fine???
DataRow [] rowsDevice = (DSDevice.DeviceRow[])dsPanel.Device.Select(
"[Parent]='" + guid.ToString() + "'", "" );

this.gridPanel.DataSource = rowsDevice;

Why the difference? Shouldn't this be the same thing? I would rather
filter with the dataview but I can't get it to work. Shouldn't all
filtering of datasets be a single code path in ADO.NET?

Thanks in advance,
Brian Nantz
 
Reply With Quote
 
 
 
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      26th Mar 2004
Hi Brian,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that your program returns different results
using DataTable's Select method and DataView's filter. If there is any
misunderstanding, please feel free to let me know.

I noticed that you have set the DataViewRowState in the DataView
constructor. However, in the latter one, it was not specified. Have you
tried to use DataRow [] rowsDevice =
(DSDevice.DeviceRow[])dsPanel.Device.Select(
"[Parent]='" + guid.ToString() + "'", "", DataViewRowState.CurrentRows );
Do they return the same result now?

If the problem still persists, could you please send me a repro package, so
that I could help to resolve this more quickly? Remove 'online' from the no
spam email is my email address. Thanks for your cooperation!

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
Brian Nantz
Guest
Posts: n/a
 
      26th Mar 2004
Kevin,

Thanks for your repsonse. This turns out to be a bug in a third party
grid I am using. I thought it was a dataview bug becuase the
dataview.table.row.count contained all the rows unfiltered. The
standard windows forms datagrid works fine. So thanks.

By the way where is the proper place to look for the filtered row count
in a dataview?

thanks,
brian
 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      26th Mar 2004
Brian Nantz <(E-Mail Removed)> wrote:
> Thanks for your repsonse. This turns out to be a bug in a third party
> grid I am using. I thought it was a dataview bug becuase the
> dataview.table.row.count contained all the rows unfiltered. The
> standard windows forms datagrid works fine. So thanks.
>
> By the way where is the proper place to look for the filtered row count
> in a dataview?


dataview.Count

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      29th Mar 2004
Hi Brian,

The DataView.Count property returns the number of records in the DataView.

For more information, please check the following link:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadataviewclasscounttopic.asp

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
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 C# .NET 5 17th Jul 2005 04:57 PM
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


Features
 

Advertising
 

Newsgroups
 


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