AC25
AC25

Reputation: 423

Uisnga DataTrigger to hide xceed data grid rows

I am working on WPF MVVM project and I have a ObservableCollection with class that contains a boolean property and a string property. That Observablecollection is bound xceedwpfgrid. I am trying to add a datatrigger that checks the boolean and based on that property shows or hides the row. I tried a few things but im not able to hit the datatrigger on the xceedgrid can someone help me.

          <TreeGrid:XceedColumnBindingGrid ItemsSource="{Binding Path=.DataList}"                                                 
                                            AutoCreateColumns="False"                                                
                                            IsTabStop="False" 
                                            SelectedItem="{Binding Path=.SelectedItem}"
                                            ContextMenuBuilder="{Binding Path=.ContextMenuBuilder}">


              <TreeGrid:XceedColumnBindingGrid.Resources>
                <Style TargetType="{x:Type DataGridRow}" >
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=.DataList.IsOnExclusionList}" Value="true">
                            <Setter Property="Visibility" Value="Visible"/>
                        </DataTrigger>

                        <DataTrigger Binding="{Binding Path=.DataList.IsOnExclusionList}" Value="false">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </Style.Triggers>

                </Style>
                 </TreeGrid:XceedColumnBindingGrid.Resources>
            <TreeGrid:XceedColumnBindingGrid.Columns>
                <xcdg:Column FieldName="IsOnExclusionList" Title="IsOnExclusionList" Width="30" CellContentTemplate="{StaticResource cellCashDeliveringTemplate}" CellEditorDisplayConditions="None"/>
                <xcdg:Column FieldName="Name" Title="Name" Width="30" CellContentTemplate="{StaticResource cellCashDeliveringTemplate}" CellEditorDisplayConditions="None"/>
            </TreeGrid:XceedColumnBindingGrid.Columns>
        </TreeGrid:XceedColumnBindingGrid>

I am hoping that the datatrigger will show and hide the row depnding on the boolean variable

Upvotes: 0

Views: 158

Answers (0)

Related Questions