Hello, I m using VS.net2003 vb.net
My question is, I have a class with a dataset in it. The dataset contains 13
tables atleast with most of them to be used for user selection that is read
only tables
One of them is a table nmed, SalesType, I have a combo box, cmbSaleType
bounded to that, this is how the binding is done;
cmbSaleType.DataBindings.Add(New Binding("DataSource",
mFcPartySetup.DSPartySetup, "SaleTypes"))
cmbSaleType.DisplayMember = "NameField"
cmbSaleType.ValueMember = "IdField"
There are controls in tabpages, some of them are disabled and are to be
supposed to be enabled only on user selection. cmbSaleType is in the customer
tab which is also disabled in the begining & enabled on user selection
When user selects a role of ac ustomer [from a checked ListBox ], customers
are loaded in the default combo, the customer tab is enabled in which the
SaleTpye Combo [cmbSAleType] is contained. Depending on what customer the
user has selected, & what sale type does he posses, I want to set the
combobox i.e. I want the system to sync with the SalertypeId property of the
selected customer
I does that like this ;
cmbSaleType.SelectedIndex = dex 'dex is a variable that exactly holds
'the index value which I need to set the combo with
nothing is wrong in the code, but the system says that specified argument
[dex] was out of range of valid values. NOTE: This is the time when the tab
is enabled but not clicked. Actually for the system, there are no items yet
existing in the combo???? why, the databinding is there, the table have
schema & rows???
Now if I click the specific tab [customers that is] the same code runs with
no errors??? clicking the tab [I haven't wrote any code for such an event as
I don't need] why unless I click the tab makes system believe there are no
items in the combo but when I click it, & the control is visually appeared,
there is nothing wrong at all???
THE SYSTEM IS BEHAVING LIKE THE CONTROL IS EITHER NOT BOUNDED OR THE TABLE /
DATASOURCE DOESN'T HAVE ENOUGH ROWS IN IT UNTILL THE CONTROL GETS VISUALLY
APPEARED & THEN ITS ALL GOOD
I posted this on MSDN NewsGroups as well since i m so desperate for the solution, I was going so smooth on the coding highway when suddenly this hurdle smashed my car & i realized that there is a whole BIG project to be debuged AGAIN! :(
--
VB.net is good