3 Answers, 1 is accepted
0
Hi Jerome,
My suggestion is that you try to implement a custom context menu if you want it to be shown from the CommandItem, as the HeaderContextMenu is meaningful to use only when it is applied on RadGrid columns, if it is triggered by a click on the CommandItem, it does not know which column should the certain action be performed on. What functionality would you want the menu to expose and on what parts of RadGrid?
Kind regards,
Tsvetina
the Telerik team
My suggestion is that you try to implement a custom context menu if you want it to be shown from the CommandItem, as the HeaderContextMenu is meaningful to use only when it is applied on RadGrid columns, if it is triggered by a click on the CommandItem, it does not know which column should the certain action be performed on. What functionality would you want the menu to expose and on what parts of RadGrid?
Kind regards,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0

Jerome
Top achievements
Rank 1
answered on 01 Oct 2010, 04:40 PM
Hi Tsvetina,
I'm trying to duplicate the functionality of hiding and showing the columns available for the grid.
I tried to create a custom menu but wasn't able to get the checkboxes to display for items other than on level 0. I have a question posted to see about resolving that as well. http://www.telerik.com/community/forums/aspnet-ajax/menu/dynamic-menuitems-as-checkboxes.aspx
I was hoping I could use the context menu from the grid and only expose the columns options.
I'm trying to duplicate the functionality of hiding and showing the columns available for the grid.
I tried to create a custom menu but wasn't able to get the checkboxes to display for items other than on level 0. I have a question posted to see about resolving that as well. http://www.telerik.com/community/forums/aspnet-ajax/menu/dynamic-menuitems-as-checkboxes.aspx
I was hoping I could use the context menu from the grid and only expose the columns options.
0
Hi Jerome,
An alternative approach would be to remove the other options from the HeaderContextMenu and leave only the Columns menu. You can achieve that by wiring the server-side PreRender event of the HeaderContextMenu and there hide all unnecessary items:
I hope that this approach results in the desired functionality.
Greetings,
Tsvetina
the Telerik team
An alternative approach would be to remove the other options from the HeaderContextMenu and leave only the Columns menu. You can achieve that by wiring the server-side PreRender event of the HeaderContextMenu and there hide all unnecessary items:
protected
void
Page_Init(
object
sender, EventArgs e)
{
RadGrid1.HeaderContextMenu.PreRender +=
new
EventHandler(HeaderContextMenu_PreRender);
}
private
void
HeaderContextMenu_PreRender(
object
sender, EventArgs e)
{
GridHeaderContextMenu menu = sender
as
GridHeaderContextMenu;
foreach
(RadMenuItem item
in
menu.Items)
if
(item.Text !=
"Columns"
)
{
item.Visible =
false
;
}
}
I hope that this approach results in the desired functionality.
Greetings,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items