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
No Data
Reply
  • 69686
    posted

    Hello,

    I am using an old sample of yours to reproduce this behavior. Please take a look at the sample - salary must be "1" to activate one of the triggers and the department has to be sales for the second trigger.

    They update when you exit edit mode. Obviously it is not the same scenario, so please correct "my" sample accordingly. Also, please tell us the exact dll version that you are using.

    Office2kLineDemo.zip
Children