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. Image for the cookie policy date

Styling a row based on a DataTrigger

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?




1 Reply

SM Saravanan M Syncfusion Team September 2, 2013 01:49 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon