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
170
Trying to bind design time sample data to XamDataGrid? Add your own sampledata?
posted

When I try to bind designtime sample data using d:DataContext nothing appears in the XamDataGrid at design time.

Why does the following not work?

<UserControl.Resources> 
        <vm:StrategyManagerViewModel x:Key="DesignViewModel">
            <vm:StrategyManagerViewModel.Strategies>
                <m:StrategyManagerItem Name="Test" />
                <m:StrategyManagerItem Name="Test2" />
                <m:StrategyManagerItem Name="Test3" />
                <m:StrategyManagerItem Name="Test4" />
            </vm:StrategyManagerViewModel.Strategies>
        </vm:StrategyManagerViewModel> 
    </UserControl.Resources>
    
    <Grid d:DataContext="{Binding Source={StaticResource DesignViewModel}}">
            <igDP:XamDataGrid
                    x:Name="StrategyManagerDataGrid" AutoFit="True"
                    DataSource="{Binding Strategies}" RecordLoadMode="PreloadRecords"
                    Theme="Office2k7Black"
                BindToSampleData="False" IsNestedDataDisplayEnabled="False">
                <igDP:XamDataGrid.Resources>
                </igDP:XamDataGrid.Resources>
                <igDP:XamDataGrid.FieldSettings>
                    <igDP:FieldSettings ExpandableFieldRecordExpansionMode="ShowExpansionIndicatorIfSiblingsExist"
                            ExpandableFieldRecordHeaderDisplayMode="NeverDisplayHeader" />
                </igDP:XamDataGrid.FieldSettings>
            </igDP:XamDataGrid>
 
    </Grid>
</UserControl>