Hello,
I have a custom object which has a dictionary as a property:
public class MyObject
{
string Name {get;set;}
Dictionary<Tuple<string, int, string>, decimal?> MyDictionary {get;set;}
}
I am setting my XamGrid's ItemSource to an ObservableCollection<MyObject> and would like to bind columns in the XamGrid to elements in my Dictionary.
MyXamGrid.Columns.Add(new TextColumn() {Key = <PATH_TO_ACCESS_MyDictionary>, Header = "MyHeader"});
Is this possible?
Hello Gary,
Thank you for following up. Since the Columns collection on the XamGrid is not a dependency property it cannot be bound to. I recommend handling the XamGrid's ColumnAutoGenereated event and add the items to the Dictionary as each new column is generated.
Let me know if you have any questions regarding this matter.