In a grid with a row selected, if a user clicks on another row, is there a way of
cancelling the selection in javascript ? Like in the BeforeRowActivateHandler ?
Thanks
Hello,
The UltraWebGrid has a BeforeRowActivateHandler and a BeforeSelectChangeHandler <both on the Client Side Events list> that you can handle and plug in the javascript necessary to accomplish this task... something like:
var MyCondition = 0;
function UltraWebGrid1_BeforeSelectChangeHandler(gridName, id){
MyCondition += 1;
if (MyCondition > 2) {
return true;
}
2 remarks:
1) searching for the 3 words: cancel row select doesn't return this thread. Searching for: cancelling row selectdoes find this thread. Maybe the search algorithm could be improved a little...
2) I have read in different places (including from Infragistics employees, thread 651) that to cancel a client side event, you use things like "return false;" or "event.returnValue = false;". But here it seems that to cancel the row select, you have to return true. Where is this documented? The help file certainly doesn't specify this in an obvious way.
regards,Thierry
Hello Thierry,
1) Duly noted.
2) Which threads/topics are you referring to? In an event handler we should always be detecting return true to effectively cancel the event. There are cases where for a particular CSOM object we can set a returnValue variable or a cancelPostBack variable to do the same thing as returning true from the event handler and the value should still be set to true. If you are finding this is not the case, can you cite some examples?