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.
Syncfusion Feedback

Disable Conditional formatting

Thread ID:

Created:

Updated:

Platform:

Replies:

117961 Jan 13,2015 10:22 PM UTC Jan 14,2015 01:53 PM UTC WPF 1
loading
Tags: GridDataControl
James
Asked On January 13, 2015 10:22 PM UTC

I've looked at the documentation for the GridDataControl and I've not seen any examples where the conditional formatting can be turned off or on.

I have a GridDataControl with records that are colored differently based on the values in a column. I want to put a checkbox outside the grid that can control whether or not the coloring is applied at all. Unfortunately the GridDataConditionalFormat does not have an "IsEnabled" property that I could bind to my checkbox. Another idea I had was adding a second GridDataCondition to the GridDataConditionalFormat and using a predicate "AND" but it seems like I have to specify a ColumnName for the GridDataCondition and cannot use the checkbox's value in this second GridDataCondition.

Does anyone know of a way to toggle the conditional formatting or use a property external to the GDC in a GridDataCondition?

Any help is appreciated.

Thanks.

James

Saravanan M [Syncfusion]
Replied On January 14, 2015 01:53 PM UTC


Hi James,

Thanks for contacting Syncfusion support,

We have analyzed your query. You could not Enable or Disable the GridDataConditionalFormat by using IsEnable property because since this property not available in GridDataConditionalFormat . But you can achieve your requirement like binding the CheckBox by interaction behavior with custom Dependency Property. Here we have bind the custom dependency property to IsChecked property of CheckBox. We have applied the conditional formatting to GridDataControl based on checkbox value in DependencyPropertyChangedCallBack method. Please refer the below code snippet.

Code snippet[XAML]:

<i:Interaction.Behaviors>

    <local:BehaviorClass Enable="{Binding Path=IsChecked, ElementName=checkbox}" />

</i:Interaction.Behaviors>

We have prepared a sample based on this and, you can download it from below location.

Sample Location: GridDataControl_ConditionalFormat.zip

Please let us know if you have any other queries,

Regards,

Saravanan.M



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.

Warning Icon 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.Close Icon

;