I have looked into the documentation for dynamic objects but i wasn’t able to find a solution
to my current problem.
I have this code :
dynamic sampleObject = new ExpandoObject();
string columnName = checkBox.Content.ToString();
sampleObject.columName = myObservableCollection;
Now, the name of my added property will be columnName, but I would like it to be the content of my checkbox.
How should I implement that ?
Thanks
Use a dictionary of named values instead of dynamic properties.
You can use a Dictionary converter to bind to specific entries in the dictionary (using the converter parameter value as the key). Code below from this link
Where you add columns to the grid via code you will need to create a binding with the correct converter and name converter parameter.