Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

DataGridView with TextBox columns and Autocomplete throws exception on mouse or enter key selection

$
0
0

Hello,

I have a DataGridView with some TextBox columns. Two of these columns use autocomplete. The problem is when I select one of the autocomplete values using the mouse or pressing the enter key I get a NoNullAllowedException, if the selection is done with the tab key I get the expected behavior of jumping to the next column to be edited. I'm pretty sure I understand what's going on, whenever I use the mouse click or the enter key to select one of the available values the DataGridView tries to insert this row even though all column values have not been entered yet.

So question is, how can I make the mouse click event and optionally the enter key jump to the next column in the row instead of trying to insert the row OR how can I delay the row insertion until the current row looses focus.

Thanks for your time.




Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>