We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridDataConditionalFormat in code

Thread ID:

Created:

Updated:

Platform:

Replies:

96768 Oct 4,2010 05:27 PM Oct 11,2010 01:39 AM WPF 1
loading
Tags: GridControl
Bill Blair
Asked On October 4, 2010 05:27 PM

I want to set the conditional formats in code. I would think this works:

GridDataConditionalFormat format1 = new GridDataConditionalFormat();
format1.Name = "format1";

GridDataStyleInfo styleInfo = new GridDataStyleInfo();
styleInfo.Background = Brushes.Red;
format1.Style = styleInfo;
format1.ApplyStyleToColumn = "Volume";

GridDataCondition condition1 = new GridDataCondition();
condition1.ColumnName = "Volume";
condition1.ConditionType = GridDataConditionType.GreaterThan;
condition1.PredicateType = Syncfusion.Windows.Data.PredicateType.Or;
condition1.Value = 500;
format1.Conditions.Add(condition1);
grid.ConditionalFormats.Add(format1);

but I get an:

{"Object reference not set to an instance of an object."} error.

I am binding to a dataset and don't set any conditions in xaml. What I am doing wrong?


Balaji K [Syncfusion]
Replied On October 11, 2010 01:39 AM

Hi Bill,

Thanks for your patience.

We are afraid that we are unable to reproduce the issue mentioned. Please revert us the modifying the attached sample and steps to reproduce the same.

Regards,
Balaji.



DataBind_DataTable_ConditionalFromat_5d5e80b4.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;