I found a lot of threads with the keywords above but mostly people are asking for sorting. I am asking for sorting at initialized moment. If the form loaded, the GridView should sort by a specific column already. If possible in XAML.
The default situation now, I don't need:
The default situation I want to have when form is loaded:
Any idea how to do that?
<sdk:DataGrid x:Name="dgv" ItemsSource="{Binding}" > <sdk:DataGrid.Resources> <CollectionViewSource x:Key="PrioritySorter" Source="{Binding .}"> <CollectionViewSource.SortDescriptions> ????? How to sort by "Active" property ASC? </CollectionViewSource.SortDescriptions> </CollectionViewSource> </sdk:DataGrid.Resources> <sdk:DataGrid.Columns > <sdk:DataGridTextColumn Header="N°" Binding="{Binding Id}" IsReadOnly="True"/> <sdk:DataGrid.Columns > <sdk:DataGridTextColumn Header="Priority" Binding="{Binding Priority}" /> <sdk:DataGrid.Columns > <sdk:DataGridTextColumn Header="Active" Binding="{Binding Id}" />
Answer: 1
Here is the link to get the solution for what you are looking for.
by : vinod8812http://stackoverflow.com/users/1056509
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog