I have two questions regarding the HeaderContextMenu in the grid:
1) How do I prevent the menu from posting back on click? I have a client-side event handler:
In this handler, I do all the processing I need client-side. However, after that client code executes, the grid still posts back. How do I prevent this? I've tried calling set_cancel(true) on the eventArgs, but the eventArgs in this case doesn't have that method. I've also tried doing the eventArgs.get_domEvent().stopPropagation() and preventDefault() as is shown in other code elsewhere, but that doesn't work either. The postback defeats my whole purpose of doing the processing client-side.
2) How do I customize the context menu options based on the column? I have added two new options to the context menu (which I add during the OnPreRenderComplete). For most of the columns, these two new options are valid, but for one column, they are not valid and so I want to hide them for only that column. How can I do this? It doesn't matter if I do this client-side or server-side.
Thanks.
1) How do I prevent the menu from posting back on click? I have a client-side event handler:
<
HeaderContextMenu
OnClientItemClicked
=
"grid_HeaderContextMenu_ClientItemClicked"
/>
In this handler, I do all the processing I need client-side. However, after that client code executes, the grid still posts back. How do I prevent this? I've tried calling set_cancel(true) on the eventArgs, but the eventArgs in this case doesn't have that method. I've also tried doing the eventArgs.get_domEvent().stopPropagation() and preventDefault() as is shown in other code elsewhere, but that doesn't work either. The postback defeats my whole purpose of doing the processing client-side.
2) How do I customize the context menu options based on the column? I have added two new options to the context menu (which I add during the OnPreRenderComplete). For most of the columns, these two new options are valid, but for one column, they are not valid and so I want to hide them for only that column. How can I do this? It doesn't matter if I do this client-side or server-side.
Thanks.