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

Split 'Columns' menu in HeaderContexMenu into submenus

3 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Devin
Top achievements
Rank 1
Devin asked on 03 Jul 2012, 02:16 PM
I have a grid with a very large number of columns (40+). We hide most by default, but we need to be able to show/hide all of them. Because there are so many columns, the 'Columns' menu in the HeaderContextMenu has become unusably large, especially on lower resolution screens. I'd like to split this menu into several much smaller menus. I've been able to add more menus to the HeaderContextMenu and move items from the 'Columns' menu into my new menus, but once I move the items, they no longer function. How can I split them into multiple menus and have them still behave as expected?

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 06 Jul 2012, 10:41 AM
Hello Devin,

Could you please debug your application locally and verify if any error appear when you are initiating an action form the problematic context menu. Sharing your code with us could help us further research on the issue and do our best to provide a proper solution.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Devin
Top achievements
Rank 1
answered on 06 Jul 2012, 01:01 PM
There are no errors, neither server side nor in the javascript. I've included an example of how I'm splitting the items up. This is being done in the OnPreRenderComplete event.



 var menuPrime = gridRuns.HeaderContextMenu.Items.FindItemByText("Columns");
 
 var et4Items = menuPrime.Items.Where(i => i.Text.Contains("ET4")).ToList();
 
 var et4Menu = new RadMenuItem("ET4 Columns");
 
 foreach (var et4Item in et4Items)
 {
     et4Menu.Items.Add(et4Item); // Adding an item to one menu seems to remove it from it's old menu
 }
 
 et4Menu.CssClass = "rgHCMCols"; // This gives the item the 'columns' icon
 et4Menu.PostBack = false;
  
 gridRuns.HeaderContextMenu.Items.Add(et4Menu);
0
Maria Ilieva
Telerik team
answered on 11 Jul 2012, 12:07 PM
Hi,

The provide code looks totally correct to me and there is nothing obvious that may cause the problematic behaviour you are facing. In such case it will be best of you open a regula support ticket and send us sample runnable application which demonstrates the issue. Thus we will be able to debug it locally and advise you further.

Kind regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Devin
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Devin
Top achievements
Rank 1
Share this question
or