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
94
Headers gone when using ExpansionIndicatorDisplayMode
posted

Hello,

 

I have a grid with nested records and I would like to display the expansion indicator only if there is subrecords. So I used the following option : ExpansionIndicatorDisplayMode="CheckOnDisplay". 

Problem : when I set the indicator, headers are gone. If I do not so, headers are well displayed.

with ExpansionIndicatorDisplayMode="CheckOnDisplay" :

 

without the option : 

 

Do you any idea to slove the problem?

 

Thank you

Guillaume

Parents
  • 69686
    posted

    Hello Guillaume,

    This looks like a styling issue as from what I can see from the screenshots, the LabelPresenters are gone, however the header record is there.  How are you setting the ExpansionIndicatorDisplayMode property? Are you using some style?

Reply
  • 94
    posted in reply to John Doe

    Here is the xaml code I uses. It is more or less the same than the one used to display a data grid as a tree

     

            <igDP:XamDataGrid Name="xamDtaGridPlanFi" GroupByAreaLocation="None" DataSource="{Binding PlanFi.Nodes}" FieldChooserOpening="xamDtaGridPlanFi_FieldChooserOpening">

                <igDP:XamDataGrid.Resources>

                    <converters:XamConverter x:Key="conv"/>

                    <Style x:Key="{x:Type igDP:FieldChooser}" TargetType="{x:Type igDP:FieldChooser}" BasedOn="{StaticResource {x:Type igDP:FieldChooser}}">

                        <Setter Property="FieldDisplayOrder" Value="SameAsDataPresenter" />

                    </Style>

                    <Style TargetType="{x:Type igDP:RecordPresenter}">

                        <Setter Property="IsExpanded" Value="True"/>

                    </Style>

                    <Style TargetType="{x:Type igDP:DataRecordPresenter}" x:Key="nestedEXPStyle">

                        <Setter Property="RenderTransform">

                            <Setter.Value>

                                <TranslateTransform X="{Binding Path=NestingDepth, Converter={StaticResource conv}}" Y="0"/>

                            </Setter.Value>

                        </Setter>

                    </Style>

     

                    <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="nestedCVPStyle">

                        <Setter Property="Margin" Value="{Binding Path=NestingDepth, ConverterParameter=cvp, Converter={StaticResource conv}}" />

                    </Style>

                    <Style TargetType="{x:Type igDP:LabelPresenter}">

                        <EventSetter Event="SizeChanged"  Handler="OnLabelPresenterSizeChanged" />

                    </Style>

                </igDP:XamDataGrid.Resources>

                <igDP:XamDataGrid.FieldLayouts>

     

                    <igDP:FieldLayout Key="master">

                        <igDP:Field Name="Label">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellWidth="260" />

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="Qty"/>

                        <igDP:Field Name="Value"/>

                        <igDP:Field Name="Nodes"/>

                        <igDP:FieldLayout.Settings>

                            <igDP:FieldLayoutSettings HeaderPrefixAreaDisplayMode="FieldChooserButton" HeaderPlacement="OnTopOnly" HeaderPlacementInGroupBy="OnTopOnly"/>

                        </igDP:FieldLayout.Settings>

                    </igDP:FieldLayout>

     

                    <igDP:FieldLayout Key="nested">

                        <igDP:Field Name="Label">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellValuePresenterStyle="{StaticResource nestedCVPStyle}"/>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="Qty"/>

                        <igDP:Field Name="Value"/>

                        <igDP:Field Name="Nodes"/>

                        <igDP:FieldLayout.FieldSettings>

                            <igDP:FieldSettings AllowResize="False"/>

                        </igDP:FieldLayout.FieldSettings>

                        <igDP:FieldLayout.Settings>

                            <igDP:FieldLayoutSettings ExpansionIndicatorDisplayMode="CheckOnDisplay" HighlightAlternateRecords="True" DataRecordPresenterStyle="{StaticResource nestedEXPStyle}" LabelLocation="Hidden"/>

                        </igDP:FieldLayout.Settings>

                    </igDP:FieldLayout>

     

                </igDP:XamDataGrid.FieldLayouts>

     

                <igDP:XamDataGrid.FieldLayoutSettings>

                    <igDP:FieldLayoutSettings AutoGenerateFields="False"/>

                </igDP:XamDataGrid.FieldLayoutSettings>

                <igDP:XamDataGrid.FieldSettings>

                    <igDP:FieldSettings AllowEdit="False" CellClickAction="SelectRecord"/>

                </igDP:XamDataGrid.FieldSettings>

            </igDP:XamDataGrid>

     

     

    Guillaume

Children