Datagrid validation problem

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I currently use the datatable.ColumnChanging event to call
my data validation method in a bound datagrid (Windows not
Web). This is causing me problems since the user must
click away from the datagrid or select another cell to run
the validation.

Is there another way to call the validate of a bound
datagrid that begins when the user first starts to type
rather than when the cell is changed or the datagrid loses
focus?

Any help in this will be greatly appreciated.

Rob
 
Hey, Rob:

This columnChanging events will only be fired when you try to commit the
change to the Dataset, by typing in the grid can't get this event to fire,
you have to move the focus to another cell to try to commit the change.

I am not sure how you want to validate when the user just starts to type,
If the validation starts at the beginning of an input typing, how can you
know what the proposed value is? if it's like a permission check, you can
try to set the readonly property of the column so the user won't be able to
input new values.

Thanks.

Aiwen
VB Data Team
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi all in the thread,

One can inherit from DataGridTextBoxColumn and subscribe to the hosted text
box's TextChanged event to perform instant input validation (for example,
when only alphanumeric characters should be allowed).
 
Back
Top