Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Net Custom Numeric TexBox.

Status
Not open for further replies.

FreshKid

MIS
Joined
Jun 17, 2008
Messages
3
Location
CA

- I am reading my data from A Dataset and all my controls are BINDED to a Custom Numeric TextBox.

ISSUE - I am having a problem with deleting the value in the textbox. I can only change the text in the textbox, but i want to be able to accept nulls in textbox.

When I chnage the text to Null, it returns to the previous value.
 
Have you tried setting the value in the datagrid at the same time you are setting the value in the textbox?

-Sometimes the answer to your question is the hack that works
 
I am not using a datagrid. Only binding to textbox controls

'Binding to textbox control
Dim sample As New Binding("Text", mDataSet.mTable, "Asset")
Me.SampleTextBox.DataBindings.Add(sample )

'The Custom Numeric textbox only allow users to enter numbers.

-when I change the text in the sampleTextbox to NULL( or empty) from the U.I, it returns to the previous value when i click on a different textbox control.
 
Numeric Text boxes need a value.

You will probably have to go with 0 or -1 in order for it to process correctly.

You would be changing it to "" which is not a valid value for a NumericTextBox. If you wrote the code for the textbox then you can simply alter your check to allow the empty string.

-Sometimes the answer to your question is the hack that works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top