Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to bind data and fill/display to DataGrid or UniformGrid from ListBox selected items (SelectionMode=Multiple)
    primarykey
    data
    text
    <p>As to my question(Title), <strong>I can already bind selected items</strong> from my listBox to my uniformGrid. <strong>BUT</strong> even if I already selected many items the UniformGrid only shows 1 item.</p> <p>Could you please tell me how to do this?</p> <p><strong>or</strong> is it possible to fill the UniformGrid with the ListBox items selected?</p> <p><strong>or</strong> What are the other options to transfer(bind) and show my selected items out from my ListBox?</p> <p><strong>or</strong> I'll just go and walk through the code if you have similar examples.</p> <p>To be exact, my ListBox items are <strong>images BUT</strong> doesnt need to be images only. I just want to know how to bind selected items to a Grid or anything that will display my ListBox selected items.</p> <p>Thank You</p> <p>XAML:</p> <pre><code>&lt;Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="SampleBinding.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480"&gt; &lt;Window.Resources&gt; &lt;DataTemplate x:Key="ItemTemplate"&gt; &lt;StackPanel&gt; &lt;Image Source="{Binding myImages}" HorizontalAlignment="Left" Height="64" Width="64"/&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/Window.Resources&gt; &lt;Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}"&gt; &lt;ListBox x:Name="listBox" HorizontalAlignment="Left" ItemTemplate="{DynamicResource ItemTemplate}" ItemsSource="{Binding Collection}" Margin="19,40,0,102" Width="200" SelectionMode="Multiple"/&gt; &lt;UniformGrid x:Name="uGrid" DataContext="{Binding SelectedItem, ElementName=listBox}" Margin="273,40,78,132" d:DataContext="{Binding Collection[0]}" Grid.Row="2" Grid.Column="2"&gt; &lt;Image x:Name="imageItem" Source="{Binding myImages}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="100"/&gt; &lt;/UniformGrid&gt; &lt;/Grid&gt; </code></pre> <p></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