Hi,
I'm using Isolated Storage, and save a value to both the TreeListView and it's GridViewDataColumn...but when my page comes up the saved sorting value is not being used, so I have to use a third value and read it and manually sort:
XAML:
<telerik:Label x:Name="ProjectTreeViewOrdering" Content="ASC" Visibility="Collapsed" telerik:PersistenceManager.StorageId="THOR_ProjectsTreeSorting" />
CODE:
string[] projectsSortingIsolatedStorage = { "THOR_ProjectsTreeSorting" };
private void OnWindowLoaded(object sender, EventArgs e)
{
isoProvider.LoadFromStorage(projectsSortingIsolatedStorage);
IEnumerable<TreeProjectViewModel> projects = ProjectsTreeView.ItemsSource as IEnumerable<TreeProjectViewModel>;
if (ProjectTreeViewOrdering.Content.Equals("Ascending"))
{
ProjectsTreeView.ItemsSource = projects.OrderBy(p => p.Name);
}
else if (ProjectTreeViewOrdering.Content.Equals("Descending"))
{
ProjectsTreeView.ItemsSource = projects.OrderByDescending(p => p.Name);
}
...which gets my TreeListView sorted, but then all the Groups collapse, which I don't want.
Using "ExpandAllGroups" had no effect.
If anyone has a better and more proper way to sort, save, and load a RadTreeListView that has a GridViewDataColumn defined within it, I sure would love to know about it. To get the list sorting to persist, I currently have a value save in the TreeListView, the GridViewDataColumn, and a "desperate" label as seen above.3 values seems like overkill to get the job done. I found without the value int he GridViewDataColumn being saved, I'd get no arrows in the TreeListView control, which was bad. Without the label value being stored, I got no sorting capability....so it's all bad at the moment.
Barry