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

[Solved] Group by in HeaderContextMenu

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
idwaikat
Top achievements
Rank 2
idwaikat asked on 12 Apr 2009, 04:24 PM
Hi all

I am using RadGrid with HeaderContextMenu enabled, I disabled grouping and I'd like to hide it from the HeaderContextMenu, I added the following code:

foreach (GridColumn column in RadGrid1.MasterTableView.Columns)
        {
            column.Groupable = false;
        }


and it works correctly, but when I tried to hide it from AutoGeneratedColumns I used the following code:

        foreach (GridColumn column in RadGrid1.MasterTableView.AutoGeneratedColumns)
        {
            column.Groupable = false;  
            
        }


but Group by, and Ungroup remains...

of course I used:

RadGrid1.ShowGroupPanel = false;
RadGrid1.GroupingEnabled = false;
RadGrid1.ClientSettings.AllowDragToGroup = false;

anyhelp please ASAP.......

Regards...

Idwaikat--










1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Apr 2009, 06:09 AM
Hi Idwaikat,

Try accessing the auto-generatedColumns in the ColumnCreated event of the Grid as shown below.

CS:
 
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        e.Column.Groupable = false
    } 

Shinu.



Tags
Grid
Asked by
idwaikat
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or