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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disabling rows depending on value of a column

Thread ID:

Created:

Updated:

Platform:

Replies:

112456 Sep 24,2013 08:00 AM UTC Oct 4,2013 05:28 AM UTC WPF 1
loading
Tags: GridControl
Michael Brieler
Asked On September 24, 2013 08:00 AM UTC

Hello,
i would like to disable rows depending on the value of a column. With the standard DataGrid i can accomplish it like this:

<DataGrid.Resources>

<Style TargetType="DataGridRow">

<Setter Property="IsEnabled" Value="True" />

<Style.Triggers>

<DataTrigger Binding="{Binding Path=IsSelectable}" Value="False">

<DataTrigger.Setters>

<Setter Property="IsEnabled" Value="False" />

</DataTrigger.Setters>

</DataTrigger>

</Style.Triggers>

</Style>

</DataGrid.Resources>

Can anyone show me how i can do this with the GridDataControl?

Thanks for your help


Gobinath A [Syncfusion]
Replied On October 4, 2013 05:28 AM UTC

Hi Michael,

 

Sorry for the delay in getting back to you.

 

We have analyzed your query and you can able to disable the rows depending on the values of a column by using the conditional format as below the code snippet.

 

Code snippet[XAML]:

 

<syncfusion:GridDataControl.ConditionalFormats>

  <syncfusion:GridDataConditionalFormat>

   <syncfusion:GridDataConditionalFormat.Conditions>

    <syncfusion:GridDataCondition ColumnName="BoolProperty"

                                            ConditionType="Equals"

                                            Value="True" />

   </syncfusion:GridDataConditionalFormat.Conditions>

   <syncfusion:GridDataConditionalFormat.Style>

      <syncfusion:GridDataColumnStyle Background="LightBlue" Enabled="False" />

   </syncfusion:GridDataConditionalFormat.Style>

 </syncfusion:GridDataConditionalFormat>

</syncfusion:GridDataControl.ConditionalFormats>

 

We have prepared a simple sample based on your requirement and please find the sample under the following location.

 

Sample: Conditional Format.zip

 

Please let us know if you have any queries.

 

Regards,

Gobinath A

 


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

;