Hello Scott,
Thank you for contacting Telerik Support.
ConditionalFormattingObjects are purposed to be used for customizing cells according to a certain condition. Similar objects for performing a certain set of actions, when a condition is met, is not available. However, I can suggest to create a custom
ConditionalFormattingObject and override its
Evaluate method, where if the evaluation is successful, you are allowed to call the desired methods for processing the necessary actions:
private
void
Form1_Load(
object
sender, EventArgs e)
{
this
.productsTableAdapter.Fill(
this
.nwindDataSet.Products);
CustomConditionalFormattingObject obj =
new
CustomConditionalFormattingObject(
"MyCondition"
, ConditionTypes.Greater,
"30"
,
""
,
false
);
obj.CellBackColor = Color.SkyBlue;
obj.CellForeColor = Color.Red;
obj.TextAlignment = ContentAlignment.MiddleRight;
this
.radGridView1.Columns[
"UnitPrice"
].ConditionalFormattingObjectList.Add(obj);
}
public
class
CustomConditionalFormattingObject : ConditionalFormattingObject
{
public
CustomConditionalFormattingObject(
string
name, ConditionTypes type,
string
tvalue1,
string
tvalue2,
bool
applyToRow)
:
base
( name, type, tvalue1, tvalue2, applyToRow)
{
}
public
override
bool
Evaluate(GridViewRowInfo row, GridViewColumn column)
{
bool
conditionMet =
base
.Evaluate(row, column);
if
(conditionMet)
{
Console.WriteLine(
"Condition met for row:{0},col{1}"
,row.Index,column.Index);
}
return
conditionMet;
}
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application.
Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>