473,849 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with ComboBox

Hi Everyone,

I'll try to explain the process I'm following, I'm new to this so I'm
triying the easy way first, probably the lasyest too!

I created a new Project, drag in to it a SQLConnection, configured,
dragged an Dataadapter per each table I need it, then generated the
dataset, after that, I stablished the relations between tables, then,
went over to the datasources, choose the parent datasource and clicked
on the + sign, it displayed me every field on that table as well as the
related tables, until here everything goes fine, after that I change
the the way I want the controls to be displayed from datagrid to form
then drag/drop the source over the form and run the form, everything is
fine until here, here's the little problem, I have a field called
'empid' wich is supposed to be a comboBox, I click over it and it
displays nothing, I went back and stablish a datasource for it, value
to display, etc, etc then, run the form again and it does display the
numbers but when I start going over them it begins to change everyvalue
on the combobox, per example, when the form is ran for the first time
it displays the values 1001, 1002 and 1003, then while it's running I
choose the diferent values and it displays them right but then when I
click on the combobox there's number 1, choose a different value then
when I go back it's showing a number 3 but numbers 1001 and 1002 are
gone, I close the form and run it again and the numbers show fine
again.

Hope I explained myself, if there's any advice on what it is what I am
doing wrong please let me know, thanks in advance!

Aug 11 '06 #1
4 1822
JJGarcia,

You have tried to explain yourself, but there are thousands of
implementations of a combobox in a datagrid (It is not standard in a
datagrid). That makes it difficult to help you with this.

As you would use a DataGridView, than it would probably be easier to help,
but the later is Net 2.0 and I assume that you use Net 1.x.

Cor

"JJGarcia" <jo***********@ gmail.comschree f in bericht
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi Everyone,

I'll try to explain the process I'm following, I'm new to this so I'm
triying the easy way first, probably the lasyest too!

I created a new Project, drag in to it a SQLConnection, configured,
dragged an Dataadapter per each table I need it, then generated the
dataset, after that, I stablished the relations between tables, then,
went over to the datasources, choose the parent datasource and clicked
on the + sign, it displayed me every field on that table as well as the
related tables, until here everything goes fine, after that I change
the the way I want the controls to be displayed from datagrid to form
then drag/drop the source over the form and run the form, everything is
fine until here, here's the little problem, I have a field called
'empid' wich is supposed to be a comboBox, I click over it and it
displays nothing, I went back and stablish a datasource for it, value
to display, etc, etc then, run the form again and it does display the
numbers but when I start going over them it begins to change everyvalue
on the combobox, per example, when the form is ran for the first time
it displays the values 1001, 1002 and 1003, then while it's running I
choose the diferent values and it displays them right but then when I
click on the combobox there's number 1, choose a different value then
when I go back it's showing a number 3 but numbers 1001 and 1002 are
gone, I close the form and run it again and the numbers show fine
again.

Hope I explained myself, if there's any advice on what it is what I am
doing wrong please let me know, thanks in advance!

Aug 12 '06 #2
o.k, sorry, what I will like to do is this, on my detail form I will
like to be able to do a search on the detail form and as I find the
searched record on the combobox(be able to search or just choose a
record from the list) the detail and datagrid will display me the
record, as I mentioned, I have the fields already related, I tried with
the datagrid view but as I am totally new to this programming world I
wasn't able to make it work for me the way I wanted, I mean, i do was
displaying the records but when I was modifiying the records it wont
save the changes, the instruction i'm using for save any changes is
[sqldataadapter. update(datatase t, "my_table")].

In resume, what I need to do is to be able to use the combobox as a
lookup device but the way I have configure it right now(i'm using the
RAD way...!) seems no to be working, it does display the records but as
I choose them the number on the combobox changes to a number that I
don't know where is getting it from.

By the way, another question, how do I change the name of the fields
that are being displayed on the datagrid beacuse right now they are
displaying the name that's on the table so it is a weird name.

thanks in advance for your help

JJGarcia

Cor Ligthert [MVP] wrote:
JJGarcia,

You have tried to explain yourself, but there are thousands of
implementations of a combobox in a datagrid (It is not standard in a
datagrid). That makes it difficult to help you with this.

As you would use a DataGridView, than it would probably be easier to help,
but the later is Net 2.0 and I assume that you use Net 1.x.

Cor

"JJGarcia" <jo***********@ gmail.comschree f in bericht
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi Everyone,

I'll try to explain the process I'm following, I'm new to this so I'm
triying the easy way first, probably the lasyest too!

I created a new Project, drag in to it a SQLConnection, configured,
dragged an Dataadapter per each table I need it, then generated the
dataset, after that, I stablished the relations between tables, then,
went over to the datasources, choose the parent datasource and clicked
on the + sign, it displayed me every field on that table as well as the
related tables, until here everything goes fine, after that I change
the the way I want the controls to be displayed from datagrid to form
then drag/drop the source over the form and run the form, everything is
fine until here, here's the little problem, I have a field called
'empid' wich is supposed to be a comboBox, I click over it and it
displays nothing, I went back and stablish a datasource for it, value
to display, etc, etc then, run the form again and it does display the
numbers but when I start going over them it begins to change everyvalue
on the combobox, per example, when the form is ran for the first time
it displays the values 1001, 1002 and 1003, then while it's running I
choose the diferent values and it displays them right but then when I
click on the combobox there's number 1, choose a different value then
when I go back it's showing a number 3 but numbers 1001 and 1002 are
gone, I close the form and run it again and the numbers show fine
again.

Hope I explained myself, if there's any advice on what it is what I am
doing wrong please let me know, thanks in advance!
Aug 12 '06 #3
JJGarcia,

Maybe I should ask my question more expliciet because you did not answer
that.

What VB version are you using and what complex data control, I am in doubt
that it is a datagrid as you wrote?

Cor

"JJGarcia" <jo***********@ gmail.comschree f in bericht
news:11******** **************@ p79g2000cwp.goo glegroups.com.. .
o.k, sorry, what I will like to do is this, on my detail form I will
like to be able to do a search on the detail form and as I find the
searched record on the combobox(be able to search or just choose a
record from the list) the detail and datagrid will display me the
record, as I mentioned, I have the fields already related, I tried with
the datagrid view but as I am totally new to this programming world I
wasn't able to make it work for me the way I wanted, I mean, i do was
displaying the records but when I was modifiying the records it wont
save the changes, the instruction i'm using for save any changes is
[sqldataadapter. update(datatase t, "my_table")].

In resume, what I need to do is to be able to use the combobox as a
lookup device but the way I have configure it right now(i'm using the
RAD way...!) seems no to be working, it does display the records but as
I choose them the number on the combobox changes to a number that I
don't know where is getting it from.

By the way, another question, how do I change the name of the fields
that are being displayed on the datagrid beacuse right now they are
displaying the name that's on the table so it is a weird name.

thanks in advance for your help

JJGarcia

Cor Ligthert [MVP] wrote:
>JJGarcia,

You have tried to explain yourself, but there are thousands of
implementation s of a combobox in a datagrid (It is not standard in a
datagrid). That makes it difficult to help you with this.

As you would use a DataGridView, than it would probably be easier to
help,
but the later is Net 2.0 and I assume that you use Net 1.x.

Cor

"JJGarcia" <jo***********@ gmail.comschree f in bericht
news:11******* *************** @b28g2000cwb.go oglegroups.com. ..
Hi Everyone,

I'll try to explain the process I'm following, I'm new to this so I'm
triying the easy way first, probably the lasyest too!

I created a new Project, drag in to it a SQLConnection, configured,
dragged an Dataadapter per each table I need it, then generated the
dataset, after that, I stablished the relations between tables, then,
went over to the datasources, choose the parent datasource and clicked
on the + sign, it displayed me every field on that table as well as the
related tables, until here everything goes fine, after that I change
the the way I want the controls to be displayed from datagrid to form
then drag/drop the source over the form and run the form, everything is
fine until here, here's the little problem, I have a field called
'empid' wich is supposed to be a comboBox, I click over it and it
displays nothing, I went back and stablish a datasource for it, value
to display, etc, etc then, run the form again and it does display the
numbers but when I start going over them it begins to change everyvalue
on the combobox, per example, when the form is ran for the first time
it displays the values 1001, 1002 and 1003, then while it's running I
choose the diferent values and it displays them right but then when I
click on the combobox there's number 1, choose a different value then
when I go back it's showing a number 3 but numbers 1001 and 1002 are
gone, I close the form and run it again and the numbers show fine
again.

Hope I explained myself, if there's any advice on what it is what I am
doing wrong please let me know, thanks in advance!

Aug 13 '06 #4
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Professional

Cor Ligthert [MVP] wrote:
JJGarcia,

Maybe I should ask my question more expliciet because you did not answer
that.

What VB version are you using and what complex data control, I am in doubt
that it is a datagrid as you wrote?

Cor

"JJGarcia" <jo***********@ gmail.comschree f in bericht
news:11******** **************@ p79g2000cwp.goo glegroups.com.. .
o.k, sorry, what I will like to do is this, on my detail form I will
like to be able to do a search on the detail form and as I find the
searched record on the combobox(be able to search or just choose a
record from the list) the detail and datagrid will display me the
record, as I mentioned, I have the fields already related, I tried with
the datagrid view but as I am totally new to this programming world I
wasn't able to make it work for me the way I wanted, I mean, i do was
displaying the records but when I was modifiying the records it wont
save the changes, the instruction i'm using for save any changes is
[sqldataadapter. update(datatase t, "my_table")].

In resume, what I need to do is to be able to use the combobox as a
lookup device but the way I have configure it right now(i'm using the
RAD way...!) seems no to be working, it does display the records but as
I choose them the number on the combobox changes to a number that I
don't know where is getting it from.

By the way, another question, how do I change the name of the fields
that are being displayed on the datagrid beacuse right now they are
displaying the name that's on the table so it is a weird name.

thanks in advance for your help

JJGarcia

Cor Ligthert [MVP] wrote:
JJGarcia,

You have tried to explain yourself, but there are thousands of
implementations of a combobox in a datagrid (It is not standard in a
datagrid). That makes it difficult to help you with this.

As you would use a DataGridView, than it would probably be easier to
help,
but the later is Net 2.0 and I assume that you use Net 1.x.

Cor

"JJGarcia" <jo***********@ gmail.comschree f in bericht
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi Everyone,

I'll try to explain the process I'm following, I'm new to this so I'm
triying the easy way first, probably the lasyest too!

I created a new Project, drag in to it a SQLConnection, configured,
dragged an Dataadapter per each table I need it, then generated the
dataset, after that, I stablished the relations between tables, then,
went over to the datasources, choose the parent datasource and clicked
on the + sign, it displayed me every field on that table as well as the
related tables, until here everything goes fine, after that I change
the the way I want the controls to be displayed from datagrid to form
then drag/drop the source over the form and run the form, everything is
fine until here, here's the little problem, I have a field called
'empid' wich is supposed to be a comboBox, I click over it and it
displays nothing, I went back and stablish a datasource for it, value
to display, etc, etc then, run the form again and it does display the
numbers but when I start going over them it begins to change everyvalue
on the combobox, per example, when the form is ran for the first time
it displays the values 1001, 1002 and 1003, then while it's running I
choose the diferent values and it displays them right but then when I
click on the combobox there's number 1, choose a different value then
when I go back it's showing a number 3 but numbers 1001 and 1002 are
gone, I close the form and run it again and the numbers show fine
again.

Hope I explained myself, if there's any advice on what it is what I am
doing wrong please let me know, thanks in advance!
Aug 13 '06 #5

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

Similar topics

1
2109
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the content of an untyped DataSet. This is to be done in the "DropDown" Event (since the dataset is empty at program start). If I go with this:
0
1164
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the content of an untyped DataSet. This is to be done in the "DropDown" Event (since the dataset is empty at program start). If I go with this:
6
7490
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times "System.Data.DataR..." is displayed inside the combobox is the amount of records in the dataset. On the other hand, if my query is "select emplcode from payemployee", the databind will work fine (but I don't want to limit the dataset to one field)....
0
2179
by: Jax | last post by:
I am using a class that inherits from the DataGridTextBoxColumn. It adds a combo box into the column where it displays a selection of choices. The problem I have is that when this comboBox loses focus I lose the selected text. And this next line isn't setting the text in the cell. // code within the custom DataGridComboBoxColumn class this.TextBox.Text = this.ComboBox.SelectedItem.ToString();
3
6838
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article: http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx I have a problem when there are two DataGrid's on one form, and when I switch focus from one grid to the other. To be more precise, when I'm editing a combo box column in one grid, and then click in the combo column of...
0
2387
by: tupolev | last post by:
Hi, I already post this item but now I know whats wrong: I want to allow the user to edit the items in a combobox. The problem is that the textchange event works just one time (for the first changed letter) because he reset the selectedindex of the combobox to -1. In debug mode I can't see where he does this. How can I solve this? My code sofar: contactlijst is a structure and the volgnummer is the index of the item in the combobox
30
4619
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a corresponding field in the lookup table. In my data table we store the ID in what I will call the 'key' field. == Description of the desired operation:
1
2076
by: amber | last post by:
I'm having an issue with a combobox that is making no sense to me at all. I have a form with several comboboxes/textboxes. The values in these boxes are based on a datarowview, which is based on a listbox.selecteditem. When a different item is selected in the listbox, all the fields are repopulated with the correct data. I have 1 combobox which is acting weird.
1
4123
by: Aleksey Timonin | last post by:
Hi guys, I have a comboBox binded to DataTable: comboBox.DataSource = MyDataTable; comboBox.ValueMember = "id"; comboBox.DisplayMember = "id";
6
2943
by: RamonPV | last post by:
Hello: I am having a problem with to linked comboxes in IE7. Here is my problem that is ONLY ocurring in IE7: I have javascripts functions to populate the second of 2 comboxes given the selected option on the first one; the scripts look to be ok since they work perfectly on firefox 3.08 and also on IE6 and IE8; I have inspected the generated combobox options code using firebug extension on firefox and they are ok; on IE7 the options for the...
0
9893
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
9738
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
10665
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
10723
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
10349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5735
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
5921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4139
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.