Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1100
Changes resulting from DataTrigger are not displayed.
posted

I have a XamDataGrid that is bound to a DataSet with multiple parent-child relationships. I have applied the following DataRecordCellArea style to it:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<Style x:Key="rowSelectionStyle" TargetType="{x:Type igDP:DataRecordCellArea}" BasedOn="{x:Static igThemes:DataPresenterOffice2k7Blue.DataRecordCellArea}">

 

 

<Style.Resources>

 

 

<LinearGradientBrush x:Key="IsSelectedBrush" EndPoint="0.5,1" StartPoint="0.5,0">

 

 

<GradientStop Color="#FFCDEEFF" Offset="0.483"/>

 

 

<GradientStop Color="#FFC9E5FF" Offset="0"/>

 

 

<GradientStop Color="#FFC4E6FF" Offset="1"/>

 

 

</LinearGradientBrush>

 

 

</Style.Resources>

 

 

<Setter Property="BorderThickness" Value="0"/>

 

 

<Style.Triggers>

 

 

<DataTrigger Binding="{Binding Path=DataItem.IsSelected}" Value="True">

 

 

<Setter Property="Background" Value="{StaticResource IsSelectedBrush}"/>

 

 

</DataTrigger>

 

 

<DataTrigger Binding="{Binding Path=DataItem.IsPartiallySelected}" Value="True">

 

 

<Setter Property="Background" Value="AliceBlue"/>

 

 

</DataTrigger>

 

 

</Style.Triggers>

 

 

</Style>

If the underlying dataset changes due to a <Row>.AcceptChanges() or <Table>.AcceptChanges() then the data on screen correctly changes, but the DataTrigger doesn't appear to have changed anything. The weird part is scrolling the affected data out of view and then back into view results in the correct application of the DataTrigger. A workaround is to perform a <DataSet>.AcceptChanges() but that is an expensive operation as my DataSet is quite large. Why is this behavior occuring and how do I correct it?

Thanks!

Parents Reply Children
No Data