User (Old forums)MemberJanuary 22, 2009 at 2:00 pmPost count: 23064
I have a master/detail gird and I need to make the rows extend out to the end of the space provided for the control. I.E they don’t want any background showing to the right of the rows. How do you suggest that I do this? One idea I had was to add a dummy column and to dynamically change it’s width to occupy the remaining space.
Imported from legacy forums. Posted by Bernard (had 3557 views)User (Old forums)MemberJanuary 23, 2009 at 11:26 amPost count: 23064
I’ve implemented this strategy. I can get the main grid dummy column to extend to fill in the control width. However, when I change the width of the detail column, the dummy columns width doesn’t change.
I’m changing the detail grid width from it’s template.
gridControl.DetailGridTemplates.Columns[“X”].Width = width;
“X” is dummy column.
Imported from legacy forums. Posted by Bernard (had 260 views)User (Old forums)MemberJanuary 23, 2009 at 11:40 amPost count: 23064
Since you do it on the template, and not on the actual instance, this is not taken into account if the grid is already drawn. You must call UpdateDetailGrids() method on the GridControl for this to work.
Imported from legacy forums. Posted by André (had 250 views)User (Old forums)MemberJanuary 23, 2009 at 3:30 pmPost count: 23064
I’m manually populating the detail grids. When I call the UpdateDetailGrids() method I loose all my detail data, so that doesn’t work for me. I tried to go back go through each main row and get its parent grid, and then change the column.width there, but that doesn’t work either. Any ideas?
Imported from legacy forums. Posted by Bernard (had 274 views)User (Old forums)MemberJanuary 26, 2009 at 3:42 pmPost count: 23064
When you populate the detail grids, you have access to the actual instance of the grid, not the template. You should be able to get the column and set its width. Moreover, if your detail grids are synchronize (GridControl.SynchronizeDetailGrids = true), then you only need to do it once.
void gridControl1_InitializingDetailGrid( object sender, InitializingDetailGridEventArgs e )
new AddingDataRowEventHandler( Grid_AddingDataRow );
“DummyColumn” ].Width = width;
Imported from legacy forums. Posted by André (had 390 views)User (Old forums)MemberJanuary 30, 2009 at 3:39 pmPost count: 23064
i’ve got a solution that works with constants but want to make it more fool proof. I compare the widths to gridControl.Width and I have to adjust the mail headers by add 21 before comparing and deciding how much to extend the dummy colum. I would like to not have to code 21 but calculate the value from the control.
Also, for the first detail grid I have to use an adjustment factor of 44. The detail grid has a SideMargin.Width of 17 so I would think that 21 + 17 = 41 would be that value for that one but 44 is what works.
How should I be calculating these?
Imported from legacy forums. Posted by Bernard (had 231 views)
- You must be logged in to reply to this topic.