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.

Styling a row based on a DataTrigger

Thread ID:

Created:

Updated:

Platform:

Replies:

110629 Aug 18,2013 06:29 PM Sep 2,2013 09:49 AM WPF 1
loading
Tags: GridControl
Mark Stevens
Asked On August 18, 2013 06:29 PM

I'm using the GridDataControl and would normally look to using conditional formatting to style the row but I'm styling the row based on a pattern of data in that row and not a value. eg. Title field has the word Mr. in it so style this row.

I'm using a DataTrigger on the GridDataRowControl and applying it to the Grid's RowStyle but the trigger doesn't seem to fire.

Could you provide an example RowStyle using a DataTrigger to change a property on that row?




Saravanan M [Syncfusion]
Replied On September 2, 2013 09:49 AM

Hi Stevens,

We have analyzed your query, If you want to set Particular Row Background using some conditions you can use the concept of ConditionalFormat. You can refer the below code snippet.

Codesnippet[XAML]:

<syncfusion:GridDataControl.ConditionalFormats>

     <syncfusion:GridDataConditionalFormat Name="condition"  >

          <syncfusion:GridDataConditionalFormat.Style>

                <syncfusion:GridDataStyleInfo Background="Red"/>

                   </syncfusion:GridDataConditionalFormat.Style>

                   <syncfusion:GridDataConditionalFormat.Conditions>

                     <syncfusion:GridDataCondition ColumnName="CustomerID" PredicateType="And" ConditionType="Equals" Value="6"/>                                                    

           </syncfusion:GridDataConditionalFormat.Conditions>

 

     </syncfusion:GridDataConditionalFormat>

</syncfusion:GridDataControl.ConditionalFormats>

 

 

We have attached the sample based on your requirement. Please find the sample.

Please let us know if you have any queries,

Regards,

Saravanan.M



GridDataControl_sample_c740f5c9.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.

;