0

I have a DataTable holding many data which some of them is relative.

My objective is group relative records together and only show one of them until the user manually expand it to see all other records on that group.

First, I used group mechanism and build the text from represent record. But this way, I must handle text space to match with column header size, which column is hide or visible, etc.

So, I used master-detail (using event), it looks better. But when I expand the record, other records appear on their own headers, not the headers of master view.

My question is how to make detail rows showing in the same header of master row because they have the same member. It's no need to create another view for them! Is there any option or something else to do that?

P/S: My trial period is expired, so I cannot ask DevExpress team for support!

Update: This is what I had

What I had

But here is what I want

What I want

That means, the detail rows will not have any header line, and use the same layout as master row. Resize columns on main view and it affects on detail row too.

Thanks

Tu Tran
  • 1,957
  • 1
  • 27
  • 50

2 Answers2

2

Do This !

Use the ViewRegistered event to get the view and set look and feel. the e.View is the new registered view..

GridControl_ViewRegistered(object sender,ViewOperationEventArgs e) 
{
 GridView view = e.View;
 // do look and feel here 
 }

And just buy the devExpress license.

  • Can you explain more, I still don't catch your thought – Tu Tran Jul 27 '12 at 01:58
  • Just in the e.View hide the column header, and de row indicator... and the columns that you don't to see... – Willie van Doren Jul 27 '12 at 10:03
  • Did you take a look at my example pictures on update section? If I do as you said, then I have to modify column visibility, size, order,... each time master view change. I leave it as a final method because the size could be not match with master view – Tu Tran Jul 30 '12 at 07:20
0

What Willie means is that when you subscribe to the `viewRegistered event you can access the new view. this is the only way, as far as i know, to access the opened detail view. At this point you can set the column headers etc. to have to same look and feel as your master view.

like:

GridControl_ViewRegistered(object sender,ViewOperationEventArgs e) 
{
  GridView view = e.View; 
  foreach Column column in view.Columns
  {
    // set the column look and feel to whatever you want it to be here
  }
}
wterbeek
  • 451
  • 9
  • 26