grid.Columns.Add( new Column( "CHECKBOX", typeof( bool ) ) );
grid.Columns["CHECKBOX"].Title = "";
grid.Columns["CHECKBOX"].Width = 100;
grid.Columns["CHECKBOX"].Fixed = true;//XceedGrid 3.1
Now how do you set or get checked state from the column. Well when creating a new data row you simple put true or false to the value of the cell. If you assign false the checkbox will be unchecked and vice versa.
//setting values
Xceed.Grid.DataRow row = this.grid.DataRows.AddNew();
row.Cells["CHECKBOX"].Value = false;
foreach(DataRow row in grid.DataRows)
if((bool)row.Cells["CHECKBOX"].Value == true)
{
//do some work
}
No comments:
Post a Comment