Web.UI ASP.NET Grid: Synchronize Checkbox States with Row Selection
Posted by: ComponentArt WebLogs,
on 16 Jun 2009 |
View original | Bookmarked: 0 time(s)
One can use the Grid's itemBeforeCheckChange and itemBeforeSelect client events to synchronize the state of checkboxes and row selection. Some extra logic is required since checkbox clicks also trigger row selection. I use the load client event is used to initially set all checked rows as selected.
ASPX:
<ComponentArt:Grid id="Grid1" ...>
<ClientEvents>
<itemBeforeCheckChange eventhandler="Grid1_onItemBeforeCheckChange" />
<itemBeforeSelect eventhandler="Grid1_onItemBeforeSelect"...