Datagrid CurrentCellChanged problem
-
I have an ArrayList bound to a datagrid. I've developed a method of validating the data entered in the TextBoxes, and forcing the user to re-enter invalid data. Unfortunately, I use the CurrentCellChanged event to test if it's necessary to move the selection back to the cell with the invalid data in it. It works fine with one exception. If you're at the end of a row of data, and press the TAB key (return is fine), you get an extra CurrentCellChanged event. The first one takes you to the beginning of the same row, and the next one takes you to the next row! This messes with my logic that determines if it's necessary to move the selection back to the cell with the error in it. Is there some way to inhibit the handling of the TAB key once you've determined that you want to select another cell?
-
I have an ArrayList bound to a datagrid. I've developed a method of validating the data entered in the TextBoxes, and forcing the user to re-enter invalid data. Unfortunately, I use the CurrentCellChanged event to test if it's necessary to move the selection back to the cell with the invalid data in it. It works fine with one exception. If you're at the end of a row of data, and press the TAB key (return is fine), you get an extra CurrentCellChanged event. The first one takes you to the beginning of the same row, and the next one takes you to the next row! This messes with my logic that determines if it's necessary to move the selection back to the cell with the error in it. Is there some way to inhibit the handling of the TAB key once you've determined that you want to select another cell?