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
315
Checkbox triggering edit
posted

I'm currently working with a grid that has checkboxes in first column, I'm using row edit templates, but I want to ignore the call to the row edit template on the checkbox column, because right now if I click the checkbox with the row selected it will fire the event.

Thank you,

Cláudio Correia

Parents
No Data
Reply
  • 3732
    Suggested Answer
    posted

    Hi Claudio,

    I assume the default cell click action is set to Edit. So it opens the RowEditTemplate after you click the checkbox, right? If you don't want to open the RowEditTemplate, then the BeforeEnterEditModeHandler should be included on the client side. To include the handler, open the properties window for WebGrid, then expand DisplayLayout --> ClientSideEvents and click on the event and select add a new handler. This will create the javaScript method signature in the HTML source page. Now you can add code to handle the event. Here is a sample:

    function UltraWebGrid1_BeforeEnterEditModeHandler(gridName, cellId)

    {

    //Add code to handle your event here.

    var col = igtbl_getColumnById(cellId);

    if(col.HeaderText == 'CheckBoxColumn')

    {

    return(true);

    }

    }

    This way when the cells in the CheckBoxColumn are clicked, the RowEditTemplate doesn’t open.

    I hope this helps.

    Thanks

     

Children