Note that there are some explanatory texts on larger screens.

plurals
  1. POXAML gridview listview with grouping cells
    primarykey
    data
    text
    <p>I have a xaml gridview inside a listview. My databinding happens in code behind. The datasource is a dataset which is populated from sql. The dataset has 6 columns. A 'Type', a 'NUM' and 4 lines which contains the address. I want to display the address lines within a single cell in the gridview, each line below the other.</p> <p>xaml</p> <pre><code>&lt;Grid x:Name="grid1"&gt; &lt;StackPanel&gt; &lt;ListView Name="listview1" Margin="10,10,10,10" IsTextSearchEnabled="True" TextSearch.TextPath="Addendum_Type" Height="400" BorderBrush="#FFA8CC7B"&gt; &lt;ListView.View&gt; &lt;GridView ColumnHeaderToolTip="Addendum Master"&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Addendum_Type}" Header="TYPE" Width="150"/&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Addendum_Number}" Header="NUM" Width="150"/&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Line1}" Header="1" Width="150"/&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Line2}" Header="2" Width="150"/&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Line3}" Header="3" Width="150"/&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Line4}" Header="4" Width="150"/&gt; &lt;/GridView&gt; &lt;/ListView.View&gt; &lt;/ListView&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; </code></pre> <p>How can I combine those four lines into one cell? <img src="https://i.stack.imgur.com/XsIEW.jpg" alt="This is what I want the Gridview to display"></p> <p>And so here is what I tried </p> <pre><code> &lt;ListView Name="listview1" Margin="10,10,10,10" IsTextSearchEnabled="True" TextSearch.TextPath="Addendum_Type" Height="400" BorderBrush="#FFA8CC7B"&gt; &lt;ListView.View&gt; &lt;GridView ColumnHeaderToolTip="Addendum Master"&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Addendum_Type}" Header="TYPE" Width="150"/&gt; &lt;GridViewColumn DisplayMemberBinding="{Binding Path=Addendum_Number}" Header="NUM" Width="150"/&gt; &lt;GridViewColumn Width="150"&gt; &lt;StackPanel&gt; &lt;TextBlock Text="{Binding Path=Line1}" Grid.Column="1" TextWrapping="Wrap"/&gt; &lt;TextBlock Text="{Binding Path=Line2}" Grid.Column="1" TextWrapping="Wrap"/&gt; &lt;TextBlock Text="{Binding Path=Line3}" Grid.Column="1" TextWrapping="Wrap"/&gt; &lt;TextBlock Text="{Binding Path=Line4}" Grid.Column="1" TextWrapping="Wrap"/&gt; &lt;/StackPanel&gt; &lt;/GridViewColumn&gt; &lt;/GridView&gt; &lt;/ListView.View&gt; &lt;/ListView&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; </code></pre> <p>But that just reads the gridview to look like</p> <p><img src="https://i.stack.imgur.com/UCFWp.jpg" alt="enter image description here"></p>
    singulars
    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.
 

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