Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>On large datasets sorting may be expensive. If screen real estate is the issue you can have one datagrid with one type of items and switch the item template to switch between both views. This way screen estate is retained, sorting isn't done twice and you have a very reliable way of keeping the sort between both views in sync.</p> <p>there are many ways to achieve the effect, the best approach depends on the specific circumstances.</p> <p>One approach would be to set two different <code>&lt;GridView&gt;</code>s as resources and select which one is used either in code or through Binding with a custom converter:</p> <pre><code>&lt;Grid&gt; &lt;Grid.Resources&gt; &lt;GridView x:Key="DefaultView"&gt; &lt;GridViewColumn Width="120"....etc/&gt; &lt;/GridView&gt; &lt;GridView x:Key="AlternativeView"&gt; &lt;GridViewColumn Width="50"....etc/&gt; &lt;/GridView&gt; &lt;/Grid.Resources&gt; &lt;ListView x:Name="MyListView" ItemsSource="{Binding DisplayValues}" View="{StaticResource DefaultView}"/&gt; &lt;/Grid&gt; </code></pre> <p>and in code behind you can switch the view, something like this:</p> <pre><code> MyListView.View = isDefault ? MyListView.TryFindResource("DefaultView") : MyListView.TryFindResource("AlternativeView") </code></pre> <p>It's also possible to use Binding and skip the code behind.</p> <p>Another approach would be to make a user control for one of the column items where the user control can display the data in two alternative states.</p> <p>Yet another possiblity is to use <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemtemplateselector.aspx" rel="nofollow">ItemTemplateSelector</a></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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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