Please advise on how to configure DisplayMemberPath properly when using multiple columns.
I have a list of Category which each contain sub Categories. I want the picker to display the value of the property "Name" in each column.
class Category
{
int Id { get;}
string Name {get; }
List<Category> SubCategories { get}
}
List<Category> categories = service.GetCategories();
ObservableCollection<List<Category>> ItemsSource; <-- This is databound to the sfPicker
** Note: this works if I don't set DisplayMemberPath - I see two columns but the type name instead of Name property
ItemsSource.Add(categories);
ItemsSource.Add(categories.First().SubCategories);
** So the problem is with DisplayMemberPath **
1. If I set it to "Name" - this doesn't work as which column/collection is it referring to? The Categories or SubCategories?
- The Xaml binding fails with error shown below
2. If I bind it to a List<string> { "Name", "Name" } -> The Xaml binding fails with the error shown below
3. If I set DisplayMemberPath in the code behind - it just doesn't do anything and I just see the "TypeName" as the string to select in the picker
Here is the Xaml error I'm getting:
Error Position 31:18. No property, bindable property, or event found for 'DisplayMemberPath', or mismatching type between value and property.
Thanks in advance!