To display different results according to the help data when using Checkbox in DataGrid, you can add the following code in the DataGrid ItemDatabase:
Private void DTGVIEW_ITEMDATABOUND (Object Sender, System.Web.ui.WebControls.DataGriditeMeventArgs E)
{
Int ID;
DataRowView DRV;
Switch (E.Item.ItemType)
{
Case ListItemType.Item:
DRV = (DATAROWVIEW) E.Item.DataItem;
ID = Convert.Toint32 (DRV ["ID"]);
IF (id% 2 == 0)
{
E.Item.cells [0] .enabled = false;
}
Break;
Case ListItemType.AlternatingItem:
Goto Case ListItemType.Item;
DEFAULT:
Break;
}
}
This can be realized, when the ID is an even number, checkbox is not available, odd, is available.