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

How to hide the ExpandColumn

3 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick Raphael
Top achievements
Rank 1
Nick Raphael asked on 21 Jun 2010, 04:46 AM

Hi,
I have a grid with a GridTableView inside.  I automatically expand all rows using HierarchyDefaultExpanded=true.  But I'd like to hide the expander column.  I've set ExpandCollapseColumn-Visible = false.  But it has no effect. 

I've attached a screen shot.

It would be great if you could help.

Nick


3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jun 2010, 05:39 AM
Hello Nick,

You can try the following code snippet to hide the ExpandColumn of RadGrid.

C#:
  
 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            (e.Item as GridDataItem)["ExpandColumn"].Visible = false
        }  
    } 

Thanks,
Princy.


0
Nick Raphael
Top achievements
Rank 1
answered on 21 Jun 2010, 07:54 AM
Hi,

I've tried your solution.  It seems to remove the Expand cell for the parent row, but not the blank cell on the child row.  As a result, the child row gets moved right across to the right.  Picture attached.

Nick

0
Princy
Top achievements
Rank 2
answered on 21 Jun 2010, 10:58 AM
Hello Nick,

Another suggestion would be using css for hiding expand/collapse column. Give a try with this and see whether it works fine for you.

CSS:
<style type="text/css">  
        .rgExpandCol  
        {  
            display:none !important;  
        }  
 </style>   

Thanks,
Princy.
Tags
Grid
Asked by
Nick Raphael
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Nick Raphael
Top achievements
Rank 1
Share this question
or