For instance, in class Athlete I have:
uint ID;
string Name;
Dictionary<string, string> statistics = new Dictionary<string, string>();
In the frontend I have a DataGridView structure bound to a list of Athletes which update ID & Name (via get, set & then raising the NotifyPropertyChanged Flag). This is done by implementing the following solution:
http://www.switchonthecode.com/tutorials/csharp-tutorial-binding-a-datagridview-to-a-collection
From a combobox the user can select what kind of athlete(basketball, football, etc.) When this is done, each instance of athlete’s dictionary is loaded with applicable statistics (Points -> 20, Steals ->2) and so on. What I want to do is have the DataGridView now bound to the ID, Name, and all values (with keys being the columns) of statistics.
Is this possible?
Thanks in advance!
You could create your own Dictionary (extending or better composing it), and implement IBindingList interface, then you should be able to bind the derived Dictionary to the DataGridView.