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

wants to hide GridExpandColumn

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shaji
Top achievements
Rank 1
shaji asked on 11 Dec 2008, 12:36 PM

Hi,

In my RadGrid control I need to hide GridExpandColumn  I have used following tag in my DesignSource

  <radG:RadGrid ID="RadGrid1" runat="server" Skin="Glassy" OnItemDataBound="RadGrid1_ItemDataBound"
          GridLines="None" AutoGenerateColumns="False" EnableAJAX="false"
              oncolumncreated="RadGrid1_ColumnCreated"      >

      <ClientSettings   AllowColumnHide="true"  AllowExpandCollapse="false" AllowGroupExpandCollapse="false"  >  
      </ClientSettings>

      <MasterTableView>
         <ExpandCollapseColumn Display="false" Visible="false" />  
                                

 

as well as in code behind I have following code...

 protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridExpandColumn)
        {
            e.Column.HeaderStyle.Width = Unit.Pixel(0);
            e.Column.Visible = false;
            e.Column.Display = false;
          
        }

    }

But it is not hiding  the "GRIDEXPANDCOLUMN"

how can I solve my issue ???

Thanks & Regards

SHAJI P.D.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Dec 2008, 01:00 PM
Hello Shaji,

The code you used should work for normal hierarchial grid but for grouping you have to check for GridGroupSplitterColumn as shown below:
cs:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridGroupSplitterColumn) 
        { 
            e.Column.HeaderStyle.Width = Unit.Pixel(0); 
            e.Column.Visible = false
            e.Column.Display = false
           
        } 
 
    } 

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