NumericUpDown

Arg81

Well-known member
Joined
Mar 11, 2005
Messages
949
Location
Midlands, UK
Programming Experience
1-3
Hey all, haven't posted for a while, thought I'd post my latest stumping :)

Using 6 NumericUpDown controls on a form for a user to enter some data - however, at times some of these may be entered as 0 (which the control reformats correctly to 00.00)

However, when the row is saved to the DB, any field with 00.00 isn't saved as that..they are blank.
Any other value works fine.

Ideas?
 
Have you tried binding the NUD's Text property to the table instead of the Value property? I can't think of anything else right off hand.

If that doesn't work I know this does, specify your own DataAdapter/DataSet and when you add a record to the dataset you specify all of the data, so you can explicitly add/change the record in the DS using the NUD's Value property

That's what I do because I always end up with the projects that have the data pulled into one global dataset and is used on 3 or more forms.
 
there is no .text property :/

A way around it (albeit dirty) is that for the ones that could contain 00.00 is have a label hidden next to the NUD. Bound the label to the dataTable and then on the submit button have the NUD value copy over to the label text...
 
Back
Top