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
95
DataGrid with nested layout and extended BindableBase
posted

Hello,

I have a datagrid with a nested layout. This is all working fine until I have created an inherited version of BindableBase.

When adding a public property of type List (normal bool and string is fine) I get an additional nested layer.

The issue disappears if I change "CustomBoolList" to internal/private/protected.

Why do I get an additional nested layer even though I have already added "Browsable=false".

public class ExtendedBindableBase : BindableBase
    {
        [Browsable(false)]
        public List<bool> CustomBoolList { get; set; }
    }

public class DataLevel1 : ExtendedBindableBase
    {
        public string L1_col1 { get; set; }
        public string L1_col2 { get; set; }
        public string L1_col3 { get; set; }
        public string L1_col4 { get; set; }
        public ObservableCollection<DataLevel2> L2_items { get; set; }
        public DataLevel1( )
        {
        }
    }
    
public class DataLevel2 : BindableBase
    {
        public string L2_col1 { get; set; }
        public string L2_col2 { get; set; }
        public DataLevel2( )
        {
        }
    }

<igDP:XamDataGrid x:Name="_dataGrid" DataSource="{Binding Path=L1}">
            <igDP:XamDataGrid.Resources>
                <Style TargetType="{x:Type igDP:XamDataGrid}">
                    <Setter Property="Background" Value="DarkGray"/>
                </Style>
                <Style x:Key="drcaStyle" TargetType="{x:Type igDP:DataRecordCellArea}">
                    <Setter Property="CornerRadius" Value="0"/>
                    <Setter Property="Background" Value="White"/>
                    <Setter Property="BackgroundAlternate" Value="WhiteSmoke"/>
                </Style>
            </igDP:XamDataGrid.Resources>
            <igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:FieldLayoutSettings 
                    HighlightAlternateRecords="True"
                    DataRecordChildIndent="50"
                    DataRecordCellAreaStyle="{StaticResource drcaStyle}"
                    >
                </igDP:FieldLayoutSettings>
            </igDP:XamDataGrid.FieldLayoutSettings>
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout Key="FL_DataL1">
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="L1_col1" Label="L1 - col1" LabelTextWrapping="Wrap" Width="70" IsReadOnly="True" AllowEdit="False" FixedLocation="FixedToNearEdge" VerticalContentAlignment="Top" />
                        <igDP:Field Name="L1_col2" Label="L1 - col2" IsReadOnly="True" AllowEdit="False" FixedLocation="FixedToNearEdge" VerticalContentAlignment="Top" />
                        <igDP:TextField Name="L1_col3" Label="L1 - col3" IsReadOnly="True" AllowEdit="False" FixedLocation="FixedToNearEdge" VerticalContentAlignment="Top" IsScrollTipField="True" />
                        <igDP:TextField Name="L1_col4" Label="L1 - col4" LabelTextWrapping="Wrap" Width="200" TextWrapping="Wrap" AcceptsReturn="True" VerticalContentAlignment="Stretch" />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
                <igDP:FieldLayout Key="FL_DataL2" ParentFieldLayoutKey="FL_DataL1">
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="L2_col1" Label="L2 - col1" IsReadOnly="True" FixedLocation="FixedToNearEdge" VerticalContentAlignment="Top" />
                        <igDP:Field Name="L2_col2" Label="L2 - col2" IsReadOnly="True" FixedLocation="FixedToNearEdge" VerticalContentAlignment="Top" />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
        </igDP:XamDataGrid>

Unfortunately, I cannot upload images.