This is a migrated thread and some comments may be shown as answers.

cell style with data triggers

2 Answers 300 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tomwe
Top achievements
Rank 1
Tomwe asked on 23 May 2013, 05:46 PM
I am looking for a sample of using Data triggers in cell style with auto commit

,something like the below style(not working)

Whenever user press a key inside the editor,i would like that the trigger will evaluate the current text

< Style x:Key="LengthStyle" TargetType="telerik:GridViewCell" BasedOn="{GridViewCellStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsValidLength}" Value="False">
<Setter Property="Background" Value="red" />
</DataTrigger>
<DataTrigger Binding="{Binding IsValidLength}" Value="True">
<Setter Property="Background" Value="green" />
</DataTrigger>
</Style.Triggers>
</Style>

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Tomwe
Top achievements
Rank 1
answered on 24 May 2013, 07:57 AM

changing UpdateSourceTrigger on the editor fix it.

0
Dimitrina
Telerik team
answered on 27 May 2013, 08:31 AM
Hi,

Indeed you could set the UpdateSourceTriggers properly to control when the PropertyChanged event will be raised (if your business object implements the INotifyPropertyChanged interface). Once such a notification is raised, the Cell Style will be updated.

Regards,
Didie
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Tomwe
Top achievements
Rank 1
Answers by
Tomwe
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or