DataView Bug?

B

Brian Nantz

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
 
K

Kevin Yu [MSFT]

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."
 
B

Brian Nantz

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
 
J

Jon Skeet [C# MVP]

Brian Nantz said:
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
 

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

Top