M
Megan
I'm currently trying to develop a solution containing a bound DataGrid
that allows insert and update functions. I'm having 2 problems that
i'd appreciate some help with.
The first problem is where I have a primary key field that I don't
want users to be able to modify. The obvious solution is to configure
the column to be read only. However, then when a user tries to insert
a record, that column is still read only and so nothing can be
entered.
The second problem i'm having is to do with validation. I have a
RowChanging event on the underlying DataTable that validates the data
and if there are any problems uses SetColumnError to flag the issue to
the user. I also have a Validating event on the DataGrid that I use to
confirm that there are no errors before a user can leave the grid. The
problem is that the RowChanging and Validating events both fire at the
same time. So that if a value is changed to an invalid value and then
the grid is left, the value has not been flagged as an error when the
Validating event runs.
I hope I have explained these issues well enough. Any help or
suggestions would be welcomed.
that allows insert and update functions. I'm having 2 problems that
i'd appreciate some help with.
The first problem is where I have a primary key field that I don't
want users to be able to modify. The obvious solution is to configure
the column to be read only. However, then when a user tries to insert
a record, that column is still read only and so nothing can be
entered.
The second problem i'm having is to do with validation. I have a
RowChanging event on the underlying DataTable that validates the data
and if there are any problems uses SetColumnError to flag the issue to
the user. I also have a Validating event on the DataGrid that I use to
confirm that there are no errors before a user can leave the grid. The
problem is that the RowChanging and Validating events both fire at the
same time. So that if a value is changed to an invalid value and then
the grid is left, the value has not been flagged as an error when the
Validating event runs.
I hope I have explained these issues well enough. Any help or
suggestions would be welcomed.