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

How To Nullify Data Bound TextBox Text

$
0
0

I have a derived TextBox that's bound to a DataTable value using a BindingSource.  I would like to let the user nullify the text if there's an initial value by hitting Escape.  I'm trying to do that by setting the Text property to string.Empty in the OnKeyPress method and then setting e.Handled = true.  It's not working.  The value remains as it was when the user entered the TextBox.   I am executing  BindingSource.EndEdit() in a Validated event handler in order to finalize the binding.

Is there any way to do what I want?

Thx.  Steve


Viewing all articles
Browse latest Browse all 2535

Trending Articles



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