This walkthrough will show you how to use OnCheckBoxClick client side event.
In this topic, you will learn the basic thing on how to enable a readonly cell using OnCheckBoxClick.
To enable readonly cell using OnCheckBoxClick
- On WebGrid1_InitializeRow, put the following code:
C# Copy Code protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { e.Row.Cells.GetNamedItem("Address").ForceNoEdit = true; }
- Select WebGrid's instance and press F4.
- In Layout Settings, select ClientSideEvents, then set OnCheckBoxClick to WebGrid1_OnCheckBoxClick.
- Write the following function in OnCheckBoxClick client side event:
JavaScript Copy Code function WebGrid1_OnCheckBoxClick(controlId, tblName, colName, checkboxValue, originalCheckBoxValue) { var WebGrid1 = ISGetObject(controlId); var selObj = WebGrid1.GetSelectedObject(); var cel = selObj.ToRowObject().GetCells(); cel[1].SetForceNoEdit(false); return true; }
- Run the project.
References
OnCheckBoxClick Property
Other Resources
Walkthrough Topics
How-to Topics