I've used some code that was provided by telerik to make it so users can only select a rows using the GridClientSelectColumn. Here is the javascript event.
function CancelNonInput(sender, args) |
{ |
alert(1); |
var e = args.get_domEvent(); |
//IE - srcElement, Others - target |
var targetElement = e.srcElement || e.target; |
//is the clicked element an input checkbox? <input type="checkbox"...> |
if(targetElement.tagName.toLowerCase() != "input" && |
(!targetElement.type || targetElement.type.toLowerCase() != "checkbox")) |
{ |
//cancel the event |
args.set_cancel(true); |
} |
} |
I'm using this on the OnRowSelecting and OnRowDeselecting with this event and it has worked in the past. However, for some reason, when I use it now, it works fine when checking the checkbox, but when I deselect the box, it clears the box and reselects it again, firing off the CancelNonInput event twice. Why is it all of a sudden reselecting the column after deselecting the column.
Thanks,
Adam