Quote:
But logically it just makes so much sense to put a List of each Parent's Children in the Parent object. For everything other than binding, this works great
You are correct here. And the approach is also quick and easy. Few Pointers for you to start.
1) You need two Classes. 1 Child and 1 Parent. Your Parent Class should contain a Child Class List object so that you can have all data of one parent object.
ex:
class ChildData
{
public int CClassID { get; set; }
public String CClassValue { get; set; }
}
class ParentData
{
public int ParentClassID { get; set; }
public String ParentClassName { get; set; }
public List<childdata> ChildList { get; set; }
}
Now your
ParentData
has all the info. Bind
ParentClassID
and
ParentClassName
to First DataGridView or ComboBox and based on the Index, Get the
ChildData
Element from
ParentData
and Bind it to your Second DataGridView or ComboBox.
If you have more specific Data Structure, Approach is same but you may need to Change your logic a little based on your requirement.
AVK