Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does the silverlight Datagrid not display the data?
    text
    copied!<p>In the below code below i get the SelectedItem from the listbox and display its contents in the second datagrid.</p> <p>If however i replace the listbox with the datagrid that is commented out, the data no longer shows in the second datagrid. Any reason as to why the data only displays in the second datagrid when i use the listbox??</p> <pre><code> &lt;ListBox Margin="5" Grid.Row="2" Grid.ColumnSpan="2" ItemsSource="{Binding NonNavBarPricerLayouts}" SelectedItem="{Binding SelectedNonNavBarItem, Mode=TwoWay}"&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{Binding Name}"/&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; &lt;!--&lt;data:DataGrid Margin="5" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding NonNavBarPricerLayouts}" SelectedItem="{Binding SelectedNonNavBarItem, Mode=TwoWay}" AutoGenerateColumns="False" CanUserResizeColumns="True" CanUserSortColumns="True" SelectedIndex="-1" GridLinesVisibility="None"&gt; &lt;data:DataGrid.Columns&gt; &lt;data:DataGridTemplateColumn Header="Pricer Layout" Width="150"&gt; &lt;data:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{Binding Name}"/&gt; &lt;/DataTemplate&gt; &lt;/data:DataGridTemplateColumn.CellTemplate&gt; &lt;/data:DataGridTemplateColumn&gt; &lt;/data:DataGrid.Columns&gt; &lt;/data:DataGrid&gt;--&gt; &lt;TextBlock Grid.Row="3" Grid.ColumnSpan="2" Margin="5,5,5,0" Text="Selected pricer layout contents:"/&gt; &lt;data:DataGrid Name="dgPricerLayoutDetail" Grid.ColumnSpan="2" Grid.Row="4" Margin="5" ItemsSource="{Binding SelectedNonNavBarItem.PricerDetails}" AutoGenerateColumns="True" CanUserResizeColumns="False" SelectedIndex="-1" IsReadOnly="True" GridLinesVisibility="None"&gt; &lt;/data:DataGrid&gt; </code></pre>
 

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