DataGridView Filter

Hello,
I'm using DataGridView to display about 50,000 records.
I've added a filter to the dataview, tried to use various implementations, but all of them work very slow (same implementation on .net 1.1 gave a much faster performance). I've tried RowFilter, RowCount, etc.
I understand that there is an option of using VirtualMode in DataGridView for a large number of records, but have found no way of filtering when using it...
Can you please direct me to the right direction of increasing the performances, or maybe tell me where am I wrong?

Thanks, Marina

[580 byte] By [MarinaGre] at [2007-12-16]
# 1
Can you describe in more detail how you are implementing your filter? If you can databind to a DataTable you can use the built-in filtering that the DataTable/BindingSource has.

With virtual mode you manually provide values using CellValueNeeded. You would store your cell values in an array/collection or some other store and then manually filter the values out and update the RowCount property in the DGV.

-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
Hi, Mark

I have a DataTable filled from a database.
First I was setting the DataSource with it, but it took a long time, so I'm just displaying those items that are shown in a window and updating the RowCount with the actual number of records in the DataTable. But when I apply a filter I need to reset the RowCount to the number of records in the filtered DataView.
When I do that the program starts to work very slow...
Then I've done a test and just did the following:

smartDataGridView1.RowCount = 1;

smartDataGridView1.RowCount = 50000;

smartDataGridView1.RowCount = 1;

smartDataGridView1.RowCount = 50000;

smartDataGridView1.RowCount = 1;

smartDataGridView1.RowCount = 50000;


The first 2 calls worked fine, but the following ones worked really really slow, when the third call working much slower then the second one.

Any ideas?

Thanks, Marina

MarinaGre at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 3
I haven't seen this. Can you open a bug so we can track the issue?

thanks!
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 4
Hi, Mark.
I have another question.
In visual studio 2003 I've used DataGrid binded to DataTable.
I was doing a filter of the datagrid using DataView.RowFilter with about 50,000 records. When I've converted the code to visual studio 2005 it started to work really slow and the bottleneck was the RowFilter assignment...
Any ideas?

Thanks, Marina

MarinaGre at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 5
I'm not aware of what changes have been made in ADO.NET in this area. Can you ask on the .NET Framework Data Access and Storage forum?

-mark
Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...