Advertisement

06.08.2007 at 02:33AM PDT, ID: 22621248
[x]
Attachment Details

DataGridView expand/collapse large amount of master-details data

Asked by nogovoia in Microsoft Visual C#.Net, Microsoft Visual Basic.Net, .NET Framework 2.0

Tags: datagridview, expand

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
[+][-]06.08.2007 at 06:59AM PDT, ID: 19242023

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.09.2007 at 12:21AM PDT, ID: 19247627

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.09.2007 at 10:20AM PDT, ID: 19249158

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2007 at 01:33AM PDT, ID: 19264391

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.12.2007 at 03:31AM PDT, ID: 19264841

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 01:09AM PDT, ID: 19272730

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 03:53AM PDT, ID: 19273277

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Microsoft Visual Basic.Net, .NET Framework 2.0
Tags: datagridview, expand
Sign Up Now!
Solution Provided By: Priest04
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.14.2007 at 01:15AM PDT, ID: 19281617

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.14.2007 at 02:18AM PDT, ID: 19281868

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32