G
Guest
Background:
I have a parent table (Employee) with two child tables (Phone and Email)
I have a datagrid bound to the dataset, with datamember = Employee for the
employee table
I have two other datagrids for the Phone and Email bound to the same
dataset, with DataMember = EmployeeToPhone and EmployeeToEmail relations,
respectively.
This allows me to select an employee in the employee grid, and the phone
numbers and emails for that employee in the phone/email grids and the
relations are maintained without me having to do anything special.
The problem I'm currently having is with validation. After the user is
completely done with their updates, I loop through all the datarows in the
GetChanges(Added) and GetChanges(Modified) method of each DataSet.DataTable.
If I encounter an invalid cell value, I would like to send focus back to that
cell in the datagrid.
Here are my problems:
1. Based on the information that I have at the time (the DataRow and column
mapping name of the incorrect-valued cell), I can't find a way to figure out
what row and column numbers this corresponds to in the DataGrid.
2. Now, say the user has a column sorted - this doesn't affect the dataset,
only the datagrid. How can I get the right row/column to select now?
3. Lastly, for the Phone and Email grids, I will need to first select the
Parent row in the Employee datagrid before selecting the right Cell to send
focus to for editing. How do I do this (maybe the answers in 1 or 2 may help
me with this one, but I am still stuck on this).
Thanks in advance!
I have a parent table (Employee) with two child tables (Phone and Email)
I have a datagrid bound to the dataset, with datamember = Employee for the
employee table
I have two other datagrids for the Phone and Email bound to the same
dataset, with DataMember = EmployeeToPhone and EmployeeToEmail relations,
respectively.
This allows me to select an employee in the employee grid, and the phone
numbers and emails for that employee in the phone/email grids and the
relations are maintained without me having to do anything special.
The problem I'm currently having is with validation. After the user is
completely done with their updates, I loop through all the datarows in the
GetChanges(Added) and GetChanges(Modified) method of each DataSet.DataTable.
If I encounter an invalid cell value, I would like to send focus back to that
cell in the datagrid.
Here are my problems:
1. Based on the information that I have at the time (the DataRow and column
mapping name of the incorrect-valued cell), I can't find a way to figure out
what row and column numbers this corresponds to in the DataGrid.
2. Now, say the user has a column sorted - this doesn't affect the dataset,
only the datagrid. How can I get the right row/column to select now?
3. Lastly, for the Phone and Email grids, I will need to first select the
Parent row in the Employee datagrid before selecting the right Cell to send
focus to for editing. How do I do this (maybe the answers in 1 or 2 may help
me with this one, but I am still stuck on this).
Thanks in advance!