473,672 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combo box values not set

Hi,
I have a combo box that I want to populate, based on the selection of
another combo box.

So when combo box A is selected, combo box B is populated with related values.

I have this all working fine, except for on the forms loading. I have
combobox B being populated after combobox A_SelectedIndex Changed event fires.

However, on the form load, when I try to retrieve the value from
"selectedva lue" , field, it is giving me "System.Data.Da taRowView". that is
the field isnt populated.

I dont understand why there is no value if the selectedindex changed event
is firing?

Can someone advise how I should be handling this. Even when the combo box
isnt yet populated, the selected index is showing as zero?.

thanks

Aug 23 '06 #1
2 1510
Ausclad,

This are probably very old issues with the combobox.
There are more solutions.
You protect the event with a boolean by that you set to true in the load
event or you set the handlers dynamicly at the end of that load event.

By instance the first is than in the event

\\\\
comboBoxIndexCh angeEvent
if swLoaded then
'do what has to be done in this event
end if
end sub
///

I hope this gives an idea,

Cor

"Ausclad" <Au*****@discus sions.microsoft .comschreef in bericht
news:1E******** *************** ***********@mic rosoft.com...
Hi,
I have a combo box that I want to populate, based on the selection of
another combo box.

So when combo box A is selected, combo box B is populated with related
values.

I have this all working fine, except for on the forms loading. I have
combobox B being populated after combobox A_SelectedIndex Changed event
fires.

However, on the form load, when I try to retrieve the value from
"selectedva lue" , field, it is giving me "System.Data.Da taRowView". that
is
the field isnt populated.

I dont understand why there is no value if the selectedindex changed event
is firing?

Can someone advise how I should be handling this. Even when the combo box
isnt yet populated, the selected index is showing as zero?.

thanks

Aug 23 '06 #2
Thanks.

I also found this website that shed some light on the problem.
http://www.codeproject.com/csharp/sc...select=1453805

basically, I moved the order in which I bound the object then added a
boolean to check that I had finished the bind.

thanks

"Cor Ligthert [MVP]" wrote:
Ausclad,

This are probably very old issues with the combobox.
There are more solutions.
You protect the event with a boolean by that you set to true in the load
event or you set the handlers dynamicly at the end of that load event.

By instance the first is than in the event

\\\\
comboBoxIndexCh angeEvent
if swLoaded then
'do what has to be done in this event
end if
end sub
///

I hope this gives an idea,

Cor

"Ausclad" <Au*****@discus sions.microsoft .comschreef in bericht
news:1E******** *************** ***********@mic rosoft.com...
Hi,
I have a combo box that I want to populate, based on the selection of
another combo box.

So when combo box A is selected, combo box B is populated with related
values.

I have this all working fine, except for on the forms loading. I have
combobox B being populated after combobox A_SelectedIndex Changed event
fires.

However, on the form load, when I try to retrieve the value from
"selectedva lue" , field, it is giving me "System.Data.Da taRowView". that
is
the field isnt populated.

I dont understand why there is no value if the selectedindex changed event
is firing?

Can someone advise how I should be handling this. Even when the combo box
isnt yet populated, the selected index is showing as zero?.

thanks


Aug 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4274
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of Agency Types, then the 2nd combo box displays a list of Organisations, depending upon the Agency Type Selected. The first combo box 'ctlType' (Unbound), Row Source: to field in 'AgencyReferralType'.
1
518
by: Giulio | last post by:
Hello, I have a continuous form with a combo box inside. From the combo box I can pick some values which, by the "after-update" event, change some other combo box values determined by a query. (i.e. I have some tree names and depending on what tree I pick on the other combo box I can pick its fruits and other properties) Now, mine is a continous form, and whenever I pick a value from the first combo box the second one correctly shows...
9
6754
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the second combo to change depending on what values the user selects in the first box, it's just that every time the user changes the first combobox, the second combobox FOR EVERY RECORD goes blank.
2
2084
by: jim | last post by:
I have created a Table that has 13 fields and 2 Primary Keys, e.g. 60 1, 60 2, ... 60 28, 61 1, 61 2, ... 61 28, etc... I want to create a Form where I can input the Primary Key values to query the Form to show the 13 fields assigned to the Primary key pair. If I create 2 Combo boxes I can only get the see the assignments for the first Primary Key, or only for the second Primary Key. I can't see how to get the lookup to use both...
1
2007
by: Arun | last post by:
Hi Group, I was trying to link a combo box with a list control and having some trouble with that. Could anyone please help me with that. Here's the example of the scenario. Combo Box ;- Country_Names (Pulls values from the country table(Just the country_name value)) (Each country will have a table by itself, For Example USA will be a
4
64595
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
10
1690
AllusiveKitten
by: AllusiveKitten | last post by:
Hi I am hoping someone can help me, I have a form with two combo boxes in it.... The first combo box gets its values from a table via an SQL query in the combo box properties. The second combo box is supposed to get its values also via an SQL query in its properties but it is depending on the result of the first combo box... ie. First combox has the names of all of the people who have received a document. (This combo box works perfectly...
1
1525
by: tremonti92 | last post by:
Hello.. I have a table with a field name called 'Professions'. There are many same multiple values for this field, for example, there are many records with the value 'Doctor' under this field. Here are the values under this field in the table: I want to make a form with a combo box where the combo box shows values under 'Professions', but I do not want the value 'Doctor' to be repeated more than once in the combo box... How can I do...
10
7125
by: truptivk | last post by:
Hello all, I have a situation and I'd appreciate it if any of you could help me. I am not sure if this is js or html but here goes. I have a main combo box (mcb) which I'm displaying some values. Based on what the user chooses, 2 combo boxes should be displayed on same page. The first combo box (CB1), should be filled with some values. The second, (CB2) however, should get loaded on basis of what is chosen in CB1. UNtil then, CB2 should be...
0
8504
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8419
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8946
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8849
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7477
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4243
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2094
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.