Hi all,
hoping someone could provide me some usefull tips here's my problem.
I'm trying to customize the .Net 2.0 DataGridView component so I can collapse/expand groups of rows like an Access master-details table view.
Since now I've followed different ways without finding the right one. On CodeProject there are many samples explaining how to do that. Unfortunately no one deals with large amounts of data, say something more than 5000 master records...
The samples I've tryed to follow explain how to add rows programmatically by reading a datatable and it works great, when you're dealing with hudreds of rows.
I've tryed also to create a mater details structure with business objects like this:
public class Form1 : Form {
private List<MasterRecord> m_masters;
}
public class MasterRecord {
private List<DetailRecord> m_details;
public List<DetailRecord> Details {
get {return this.m_details;}
}
[...]
}
public class DetailRecord {
[...]
}
I've created the master list and bound to the datagridview with the DataSource property. It works, but it doesn't allow me to add the details row when I try to expand the master row since I'm using a bound datagridview.
If the rows are added one by one reading the MasterRecord list it takes minutes to fill the grid when I have more than 1000 master entries...
Tried also to use the virtual mode and CellValueNeeded event. Nothing to do. As I expand the master record rowindexes get messed up...
Any idea?
Start Free Trial