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
90
IsExpanded in xaml without code behind
posted

I have hierarchical xamDataGrid which we would like to expand and collapse after click on button.

Also, we are using MVVM so there is no code behind.

So I found solution that we need to use IsExpanded in xaml using style for DataRecordPresenter. Something like this:

        <Style TargetType ="{x:Type igDP:DataRecordPresenter}">
          <Style.Triggers>
            <DataTrigger Binding="{Binding Path=DataContext.ExpandAll, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}}"  Value="True">
              <Setter Property="IsExpanded" Value="True"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=DataContext.ExpandAll, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}}"  Value="False">
              <Setter Property="IsExpanded" Value="False"/>
            </DataTrigger>
          </Style.Triggers>
        </Style>

Off course is not working. But when I change property to for example Background then it's works fine.

Please help us.

Parents Reply Children
No Data