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
95
Web Grid: CheckBox
posted

Hi,

I have an unbound checkbox column in webgrid. I want to access the checkbox on the client side and want to check/uncheck the checkbox. I was using below code

RejectGridCell = oRow.getCellFromKey(

'columnheader');

to get value // RejectGridCell.getValue()

to set value //RejectGridCell.setValue()

I want to access the checkbox directly and set the values instead of accessing the cell value.

Thanks

Parents
No Data
Reply
  • 45049
    Suggested Answer
    posted

    While you can theoretically get at the checkbox that was rendered by this column directly as an HTML element, I'd suggest against it.  Any changes made to the checkbox through JavaScript (as opposed to through the user interface) may not be persisted back to the cell, and thus may not be accessible later.

    If you want to directly access a checkbox contained in a WebGrid cell, the best suggestion I have is to use a templated column instead, and to place a checkbox control inside the cell template of the column.

Children
No Data