views:

311

answers:

3

I have a dataset which is about 3 million records, and I would like to load them in to a Data Grid within an application (WinForm).

What is the best approach / method of displaying the data.

I need to be able to run a filter to the data to reduce down the data set, ideas would be welcomed

+1  A: 

A good idea would be filtering the data in the database and retrieving only the (pre)filtered result set. If this set is still large, use virtual mode, but also rethink your design - if you want to display so much data, that you are getting into performance problems, you might be showing to much data for a user, too.

Daniel Brückner
A: 

In addition to filtering you should also consider paging in the backend (your SP should handle paging)

Rashmi Pandit
A: 

You can bind the grid to the DataSet, using the DataSource property and a BindingSource component. The Forms designer can take care of the creation of the BindingSource for you. The BindingSource has a Filter property that allows you to filter the content of the DataSet

EDIT: by the way, in data-bound mode, the DataGridView implicitly uses virtual mode, so you don't have to worry about having too many rows in the grid

Thomas Levesque