// Finds all the checkboxes in the context menu.
$(
function() {
$(
":checkbox").filter(function() {
return this.id.match('rghcMenu')
}).click(
function() { OnContextMenuClick(this) });
}
);
var
columnHash;
// Triggered when the columns slide open.
function
OnHeaderContextMenuClientItemOpened() {
for (var key in columnHash) {
var control = document.getElementById(key);
control.checked = columnHash[key];
}
}
// Maintains the state of the checkbox.
function
OnContextMenuClick(checkBox) {
if (columnHash == null) {
columnHash =
new Object();
}
columnHash[checkBox.id] = checkBox.checked;
}
and then have this in the HeaderContextMenu on the grid:
<
HeaderContextMenu OnClientItemOpened="OnHeaderContextMenuClientItemOpened" />
I hope that this helps people. I found it frustrating to figure out how to do it. We put ours in our skins for all themes and put the javascript and JQuery above in an embedded resource file which we load up on any page with a Rad Grid.
Mike Moser