Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox null date
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Database:
MS SQL Server
Miscellaneous
Thread ID:
01063867
Message ID:
01063897
Views:
7
>>I am trying to bind a mmTextbox to a date field on a windows Form. The field permits null. If the field contained a value at one time, how can the user clear out the value and set it to null?
>
>Do you want to add a button or other control to the form that the user can use to clear the textbox or do you always want to set it to null if it's empty? You could do something like this in the form if you want the latter:
>
>
textBox1.DataBindings[0].Parse += new ConvertEventHandler(Form1_Parse);
>
>private void Form1_Parse(object sender, ConvertEventArgs e)
>{
>   if (e.Value.ToString() == string.Empty)
>   e.Value = DBNull.Value;
>}
>
>Regards,


That worked great,

Thanks!

Russ Gonring
Previous
Reply
Map
View

Click here to load this message in the networking platform