ConditionalFormattingObject obj = new ConditionalFormattingObject("MyCondition", ConditionTypes.Greater, "30", "", true); |
obj.CellForeColor = Color.Red; |
obj.RowBackColor = Color.SkyBlue; |
this.radGridView1.Columns[1].ConditionalFormattingObjectList.Add(obj); |
Hi, is it possible to use the conditional format object to format rows based on a checkbox value? if the value is true I want to apply a format, like the excerpt from the documentation above. When I've tired with equal/greater than 0/1 it just raises an exception. If it's not possible in this manner, can you consider adding a IsTrue/IsFalse ConditionType.
I also tried to achieve what I wanted by:
private void grdTWatchHotList_RowFormatting(object sender, RowFormattingEventArgs e) |
{ |
if ((bool)e.RowElement.RowInfo.Cells["MarkedForDeath"].Value == true) |
{ |
e.RowElement.ForeColor = Color.Red; |
e.RowElement.DrawFill = true; |
} |
else |
{ |
e.RowElement.ResetValue(Telerik.WinControls.VisualElement.ForeColorProperty); |
} |
} |
But this didn't work... initially i through it did but once I added more rows and started scrolling up and down then everything just started getting hilighted in red!
ps the help page ms-help://telerik.winforms.8.0/telerik.winforms/topic24361.html has & etc errors in the c# example.
Cheers
Ewart.