Hi Stelios,
You would have to derive the GridStaticCellRenderer and override these methods.
protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style)
{
bool b = false;
ButtonState state = ButtonState.Pushed;
if( style.CellValue != null && style.CellValueType == typeof(bool))
{
b = (bool) style.CellValue ;
if(b)
{
state = ButtonState.Normal;
}
}
ControlPaint.DrawButton(g,clientRectangle,state);
}
protected override void OnClick(int rowIndex, int colIndex, MouseEventArgs e)
{
base.OnClick (rowIndex, colIndex, e);
bool b = (bool)this.Grid.Model[rowIndex,colIndex].CellValue;
this.Grid.Model[rowIndex,colIndex].CellValue =!b;
this.Grid.RefreshRange(GridRangeInfo.Cell( rowIndex,colIndex));
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/ToggleButtonCell_12ad16e3.zipLet me know if this helps.
Thanks,
Haneef