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
3788
Conditional BoundcheckboxField
posted

Hi,

 i am using BoundcheckboxField in webdatagrid. i want some checkbox ReadOnly and some of them

editable, how can i do this?

 

  • 33839
    Suggested Answer
    posted

    Hi Mypost,

    You should do this similarly to how make some cells in a column read-only.  You probably should just handle valueChanging client event on editing core and for the rows you want readonly for this column, set args.set_cancel(true);

    regards,
    David Young 

  • 49378
    posted

    Hi Mypost,

    Thank you for posting in the community.

    I suggest that you handle the MouseDown clientside event in this scenario in order to set the source image for the desired readonly checkboxes. For instance:

    Code Snippet
    1. function WebDataGrid1_Grid_MouseDown(sender, eventArgs) {
    2.  
    3.     if (eventArgs.get_item().get_column().get_key() == "CheckboxCol") {
    4.         //set the src of the checkbox directly
    5.         eventArgs.get_item().get_element().children[0].src = "ig_res/Default/images/ig_checkbox_off.gif";
    6.     }
    7. }// -->

    Please let me know if this helps.