Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Toolkit Datagrid Bug
    primarykey
    data
    text
    <p>i have a tab control with 2 tabs. the content of each tab is binded to a ListCollectionView and the data template has a grid showing the items. The problem is that if you click on any of the columns to sort, if I select the other tab and return to the first tab the sorting is cleared. Is it a known bug?</p> <p>here is the code:</p> <pre><code>&lt;Window x:Class="WpfApplication3.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit" Title="Window1" Height="538" Width="1223"&gt; &lt;Window.Resources&gt; &lt;DataTemplate x:Key="TestTemplate"&gt; &lt;toolkit:DataGrid ItemsSource="{Binding}" AutoGenerateColumns="false" IsReadOnly="True" &gt; &lt;toolkit:DataGrid.Columns&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding IntVal}" Header="Number"&gt;&lt;/toolkit:DataGridTextColumn&gt; &lt;toolkit:DataGridTextColumn Binding="{Binding StringVal}" Header="String"&gt;&lt;/toolkit:DataGridTextColumn&gt; &lt;/toolkit:DataGrid.Columns&gt; &lt;/toolkit:DataGrid&gt; &lt;/DataTemplate&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;TabControl&gt; &lt;TabItem Header="tab1" ContentTemplate="{StaticResource TestTemplate}" x:Name="a" Content="{Binding}"/&gt; &lt;TabItem Header="tab2" ContentTemplate="{StaticResource TestTemplate}" x:Name="b" Content="{Binding}"/&gt; &lt;/TabControl&gt; &lt;/Grid&gt; </code></pre> <p></p> <p>code behid:</p> <pre><code>public partial class Window1 : Window { public Window1() { InitializeComponent(); List&lt;test&gt; intt = new List&lt;test&gt; { new test { IntVal = 5, StringVal = "abc" }, new test { IntVal = 12, StringVal = "cc" }, new test { IntVal = 2, StringVal = "sdgc" }, new test{IntVal=64,StringVal="df"}, new test{IntVal=1234,StringVal="werw"}, new test{IntVal=14,StringVal="sdvvd"}, new test{IntVal=136,StringVal="aasr"} }; List&lt;test&gt; intt2 = new List&lt;test&gt; { new test { IntVal = 5, StringVal = "abc" }, new test { IntVal = 12, StringVal = "cc" }, new test { IntVal = 2, StringVal = "sdgc" }, new test{IntVal=64,StringVal="df"}, new test{IntVal=1234,StringVal="werw"}, new test{IntVal=14,StringVal="sdvvd"}, new test{IntVal=136,StringVal="aasr"} }; this.a.DataContext = new ListCollectionView(intt); this.b.DataContext = new ListCollectionView(intt2); } public class test { public int IntVal { get; set; } public string StringVal { get; set; } } } </code></pre>
    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.
    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