Hi!
I have two datagrids on form. Master presents people and detail their phone numbers. As data source there is two IList: IList<Person>
and IList<ContactNumber>
. Since the DataRelation object is out I'm using SelectionChanged event on master data grid to change display of contact numbers in details grid (I give null to details grid data source and reasing it to new collection of contact numbers. Maybe it's better to use filter?).
I want to allow user to add new contact numbers and new persons and having trouble with validation. If there are errors in details grid I don't want to allow user to change selection in master grid.
Do you have any patterns if doing that?
What is more interesting let's say I have two rows in master grid and one row in details grid. I add one row to details grid and fill it with invalid data. Then I try to change selection in master grid and it allowes me to do that! the OnSelectionChanged event in master gird raises before onRowValidating in details grid... It's just sad :/. I'm thinking about moving edit and adding new rows to modal forms. Do you think this is good idea? It seems like I will avoid all above issues by doing that...