Hello,

i have a question. I m using a Tabcontrol having 3 TabPages.

on the Third TabPage i have some textboxes. Some Textboxes are used for inputs and some are for the calculated values.

i.e I Take input for yarn cost per meter and by multiplying its value with total order qty i show the calculated value in other Textbox.

The problem is when i edit a record and the SelectedIndex of TabControl is not TabPage 3 and when i save the record without moving to TabPage 3 i receive an error shows that Input String was not in Correct Format. But when i move to that TabPage i receive no error and record successfully saves. Whereas i have all the textboxes populated by using DataBindings.

What could be the problem.

Thanks

You are doing it wrong. Since you posted no code showing what you are doing, that's the best answer that can be given.

The problem is when i edit a record and the SelectedIndex of TabControl is not TabPage 3 and when i save the record without moving to TabPage 3 i receive an error shows that Input String was not in Correct Format. But when i move to that TabPage i receive no error and record successfully saves. Whereas i have all the textboxes populated by using DataBindings.

Itsa hard to tell, since we dont have any code here.
But for 1st error (input string is not in correct format), that means that some value in your textBoxes (or in some other controls) are not in the format as the code would want to - I mean when you try to do the saving, and some values in the code are type (for instance) integer (saving code want them to be an integers - so numbers), and your textBox is empty, that means here will be an error. Empty is same like null (almost), but its not good enough for the integer value. Integer cannot be null (lets leave now Nullable types now).

Why you dont get an error, when you move to tab three? Is it that the code does the databinidng (or textBoxes populations) while selecting tab three? Double check the code please, when dataBinding is done.

Mitja

This article has been dead for over six months. Start a new discussion instead.