Please note: In an effort to better serve you, we are in the process of restructuring DevCenter.
In the process, we have moved many items that you may be used to finding in DevCenter over to the
Main Site. If you are having trouble locating something,
please try looking at the following places:
This article demonstrates how to loop through the WebGrid rows on the client, then set the values for checkbox cells when a header is clicked within the WebGrid.
The best method for setting the values for all cells in a column when the header is clicked is to handle the client-side ColumnHeaderClick event. Set the handler to be used within the property pages or in code:In VB.NET:
Setting a value of 1 (to check) or 0 (to un-check) on a cell using the setValue() client-side function affects the checkbox state when the ColumnType of the column is ColumnType.CheckBox (this is declared at design-time or assigned from server-side code). If the ColumnType was not CheckBox, then setting this value onto a cell would overwrite the checkbox with the literal value '1' or '0'.