Hi,
In our project we are using the RadGridView to display the contents of a conceptual folder: the contents of a folder can be either other folders / and / or items.
The grid contains an ObservableCollection contains objects of two types: "Folder" and "Item", which have no common base type, but both have the property called "Name" returning a string.
When the grid shows listitems which are of the same type, eg. only folders, or only items, sorting by the "Name" column (bound to the name property), works just fine.
Our problem:
When the grid shows listitems which are of the mixed types, eg. folders and items, sorting by the "Name" column (bound to the name property), only sorts the first time, but from there on does nothing.
The mentioned column is defined within the RadGridView as follows:
the collection holding both types of folder and items is defined on our model as follows:
We are leaning towards implementing custom sorting, but it feels like a workaround to do such, so our question is:
What would be your recommended approach to support sorting of mixed types in the Observable collection?
Further details:
WPF 4.5
Windows 7 64x
Telerik RadControls for WPF v2011.2.1004.40 / Runtime v4.0.30319
Language C#
Awaiting your response and kind regards.
In our project we are using the RadGridView to display the contents of a conceptual folder: the contents of a folder can be either other folders / and / or items.
The grid contains an ObservableCollection contains objects of two types: "Folder" and "Item", which have no common base type, but both have the property called "Name" returning a string.
When the grid shows listitems which are of the same type, eg. only folders, or only items, sorting by the "Name" column (bound to the name property), works just fine.
Our problem:
When the grid shows listitems which are of the mixed types, eg. folders and items, sorting by the "Name" column (bound to the name property), only sorts the first time, but from there on does nothing.
The mentioned column is defined within the RadGridView as follows:
<
telGrid:GridViewDataColumn
Width
=
"300"
Header
=
"Name"
DataMemberBinding
=
"{Binding Name}"
CellStyleSelector
=
"{StaticResource ColumnNameCellStyleSelector}"
>
the collection holding both types of folder and items is defined on our model as follows:
ObservableCollection<
object
> _items =
new
ObservableCollection<
object
>();
We are leaning towards implementing custom sorting, but it feels like a workaround to do such, so our question is:
What would be your recommended approach to support sorting of mixed types in the Observable collection?
Further details:
WPF 4.5
Windows 7 64x
Telerik RadControls for WPF v2011.2.1004.40 / Runtime v4.0.30319
Language C#
Awaiting your response and kind regards.