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
8920
Adding events making bound checkboxes fields visible and unvisible
posted

In attached web site there is a grid that has two BoundCheckBoxFields in columns Finalize and Reject.

I need to add client code so checking one checkbox making another checkbox in the same row invisible and

other way around unchecking make other in the same row visible again. Please update the site. I can't see needed references in documentation.

Thanks.

wdgPostBack.rar
  • 8920
    Suggested Answer
    Offline posted

    I found that Editing_CellValueChanged(sender, eventArgs)  actually get fired on click and combine info in you post with some other findings to address the issue.

    Thamks

  • 37874
    Verified Answer
    posted

    Hello mcseidel,

    The cell editing client-side events are not fired for Checkbox fields so I would suggest you to use the grid's Click event. For example:

     

    Code Snippet
    1. function onClick(sender, eventArgs) {
    2.     if (eventArgs.get_browserEvent().target.tagName == "IMG" &&
    3.         eventArgs.get_browserEvent().target.id.startsWith('x:wdgSuI')) {
    4.         if (eventArgs.get_browserEvent().target.parentNode.nextSibling != null) {
    5.             if ($($(eventArgs.get_browserEvent().target)[0]).attr('chkstate') == "1") {
    6.                 eventArgs.get_browserEvent().target.parentNode.nextSibling.getElementsByTagName("img")[0].style.visibility = "hidden";
    7.             } else {
    8.                 eventArgs.get_browserEvent().target.parentNode.nextSibling.getElementsByTagName("img")[0].style.visibility = "visible";
    9.             }
    10.         }
    11.     }
    12. }

    Let me know if this helps.