Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing a Datagrid as a Datagrid.RowDetailsTemplate
    primarykey
    data
    text
    <p>I want to use a Datagrid as conten of another Datagrid's RowDetailsTemplate. It works nerarly perfect, but there is the problem, that the child Datagrid ColumnDefinition seems to have no effect. </p> <p>Here is my Code:</p> <pre><code>&lt;toolkit:DataGrid VerticalAlignment="Top" HorizontalAlignment="Stretch" AutoGenerateColumns="False" ItemsSource="{Binding Hauptgruppen}" IsReadOnly="False" x:Name="HauptgruppenDataGrid" CanUserAddRows="False" SelectionUnit="FullRow" gridtools:DataGridStyle.SelectAllButtonTemplate="{DynamicResource CisSelectAllButtonTemplate}" SelectedValuePath="." CanUserResizeColumns="True" &gt; &lt;toolkit:DataGrid.RowDetailsTemplate&gt; &lt;DataTemplate&gt; &lt;Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FF4E5790"&gt; &lt;toolkit:DataGrid VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="50,5,5,5" ItemsSource="{Binding ElementName=HauptgruppenDataGrid, Path=SelectedValue.BerechtigteUntergruppen}" x:Name="UntergruppenDataGrid" IsReadOnly="False" CanUserAddRows="False" SelectionUnit="FullRow" gridtools:DataGridStyle.SelectAllButtonTemplate="{DynamicResource CisSelectAllButtonTemplate}" SelectedValuePath="." CanUserResizeColumns="True" &gt; &lt;toolkit:DataGrid.RowDetailsTemplate&gt; &lt;DataTemplate&gt; &lt;Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FF4E5790"&gt; &lt;toolkit:DataGrid VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="50,5,5,5" ItemsSource="{Binding ElementName=UntergruppenDataGrid, Path=SelectedValue.BerechtigteRisiken}" x:Name="RisikenDataGrid" IsReadOnly="False" CanUserAddRows="False" SelectionUnit="FullRow" gridtools:DataGridStyle.SelectAllButtonTemplate="{DynamicResource CisSelectAllButtonTemplate}" SelectedValuePath="." CanUserResizeColumns="True" &gt; &lt;toolkit:DataGrid.RowDetailsTemplate&gt; &lt;DataTemplate&gt; &lt;risikoControls:RisikoDetails Risiko="{Binding ElementName=RisikenDataGrid, Path=SelectedValue}" /&gt; &lt;/DataTemplate&gt; &lt;/toolkit:DataGrid.RowDetailsTemplate&gt; &lt;toolkit:DataGrid.Columns&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=Sortierung}" Header="Sortierung" /&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=RisikoBezeichnung}" Header="Risiko" /&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=Beschreibung}" Header="Beschreibung" /&gt; &lt;/toolkit:DataGrid.Columns&gt; &lt;/toolkit:DataGrid&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/toolkit:DataGrid.RowDetailsTemplate&gt; &lt;toolkit:DataGrid.Columns&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=LfdNr}" Header="LfdNr" /&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=Gruppe}" Header="Gruppe" /&gt; &lt;/toolkit:DataGrid.Columns&gt; &lt;/toolkit:DataGrid&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/toolkit:DataGrid.RowDetailsTemplate&gt; &lt;toolkit:DataGrid.Columns&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=LfdNr}" Header="LfdNr" /&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding Path=Gruppe}" Header="Gruppe" /&gt; &lt;/toolkit:DataGrid.Columns&gt; &lt;/toolkit:DataGrid&gt; </code></pre> <p>So when I look at the compiled program, the child DataGrids show all Colums of the table I bound to them, not only the one I spezified. So, I hope you can help me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload