0

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

AC25
  • 413
  • 1
  • 7
  • 23
  • Could you not bind the Visibility to the Boolean value and use a BoolToVisConverter? – Ginger Ninja May 10 '19 at 21:15
  • thast not the question, the question that the trigger does get pulled how i make invisible from there I dont care – AC25 May 11 '19 at 01:54
  • My immediate guess is that you are binding to a property on the `DataList` and that is not raising a `OnPropertyChanged` event. Usually you need to make it a seperate property in your Viewmodel that raises an event. You may want to post your viewmodel code to get further ability to troubleshoot – Ginger Ninja May 13 '19 at 05:54
  • your not getting it, how to dig into the grid it has nothing to do with the datalist – AC25 May 15 '19 at 14:18
  • if your bindings and properties are setup properly, you shouldnt need to dig into the Grid. – Ginger Ninja May 15 '19 at 15:08

0 Answers0