This is a migrated thread and some comments may be shown as answers.

Master detail grid where detail tables all expanded

2 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
andieje
Top achievements
Rank 1
andieje asked on 21 Jul 2009, 03:05 PM
Hello

How would i create a master details grid where all of the details table are expanded on page load.

The details tables remain expanded permanently so I would also like to remove the expand/collapse column

thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 22 Jul 2009, 05:51 AM
Hi,

I guess you are trying to Expand the entire master table rows and hence expose the Detail table. If so you can try the following code snippet to achieve the desired scenario.

CS:
 
 protected void RadGrid2_PreRender(object sender, EventArgs e) 
    {
       //to expand the entire master table rows
        foreach (GridDataItem item in RadGrid2.MasterTableView.Items) 
        { 
            item.Expanded = true
        } 
       
        // to hide theExpand/Collapse column
        RadGrid2.MasterTableView.GetColumn("ExpandColumn").Display = false
 
    } 

You can also set the HierarchyDefaultExpanded property of the Grid to true to expand  the entire master table rows.

Thanks
Shinu
0
andieje
Top achievements
Rank 1
answered on 22 Jul 2009, 08:31 PM
Hi

That sort of works for me. Setting the display to false hid the column but for some reason made it really wide. Lets say when the column was visible its width was 10px, when i hid it the empy space became more like 100px. So instead of hiding it programmatically i hid it throught style sheet by adding this to top of my page

 <style> 
.RadGrid_SureTrack .rgCollapse  
{  
  visibility:hidden !important;  
  width: 0px;  
}  
</style> 
Tags
Grid
Asked by
andieje
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
andieje
Top achievements
Rank 1
Share this question
or