Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Javascript Cancel row selection change in BeforeRowDeactivate handler
posted

Hi,

I am using Infragistics version 10.2 and have a UltraWebGrid on my page. I am handling the BeforeRowDeactivate event in Javascript to update grid cells with some data from other controls on the page. On a certain condition inside this event I would like to cancel the row selection event and keep the current selected row. Is this possible from within Javascript? Any samples would help.

 

Thanks!

Parents
No Data
Reply
  • 49378
    Suggested Answer
    posted

    Hi pdharmesh,

    It has been a while since your post, however in case you still need assistance I would be glad to help.

    I am attaching a sample for you which demonstrates how the row selection changed event can be cancelled upon a certain condition. The sample uses the Northwind DB and if the index of the currently selected row is even, the selection of a new row is cancelled.

    Below is the javascript code used:

    function UltraWebGrid1_BeforeRowDeactivateHandler(gridName, rowId){
       //if the index of current row is even - cancel selection, else proceed
        if (igtbl_getRowById(rowId).getIndex() % 2 == 0) {
            return true;
        } else {
            return false;
        }
    }

    Hope this helps. Please contact me if you have any questions.

    UltraWebGridBeforeRowDeactivateSample.zip
Children
No Data