JJ
Jisha Joy
Syncfusion Team
November 26, 2008 10:07 AM UTC
Hi Ediberto,
The intended behavior can be achieved by handling a couple of events. Please refer the code:
this.gridDataBoundGrid1.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);
this.gridDataBoundGrid1.CurrentCellChanged+=new EventHandler(gridDataBoundGrid1_CurrentCellChanged);
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
GridModel model = this.gridDataBoundGrid1.Model;
int ColIndex = this.gridDataBoundGrid1.Model.NameToColIndex("Check1");
if (e.RowIndex > 0 && e.ColIndex == ColIndex)
{
if (this.gridDataBoundGrid1.Model[e.RowIndex, e.ColIndex - 1].Text == "True")
{
e.Style.Text = "False";
}
if (this.gridDataBoundGrid1.Model[e.RowIndex, e.ColIndex - 1].Text == "False")
{
e.Style.Text = "True";
}
}
}
private void gridDataBoundGrid1_CurrentCellChanged(object sender, EventArgs e)
{
GridModel model = this.gridDataBoundGrid1.Model;
int ColIndex = this.gridDataBoundGrid1.Model.NameToColIndex("Check");
GridCurrentCell cc= this.gridDataBoundGrid1.CurrentCell;
if(cc.RowIndex > 0 && cc.ColIndex == ColIndex)
{
this.gridDataBoundGrid1.RefreshRange(GridRangeInfo.Cell(cc.RowIndex,cc.ColIndex+1));
}
}
Please try this and let me know if you need further assistance.
Regards,
Jisha