473,802 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox in Bound DataGrid (VB 2003)

Hello, I'm using a DataGrid to add a product to an order. I would like
to fill in a child field (a foreign key) by bringing up a ComboBox
inside the the datagrid cell (like in the latest Northwind database) so
that it shows all available options and I can select the right one.
E.g. in the Orders datagrid I can simply select the product to order by
using a dropdown list

I'm using access 2003 and a VB .NET 2003. I need a solution that is
quick to do and if possible can be done without having to add too much
code (time is short). Thanks.

Apr 13 '06 #1
4 5219
Azis,

There is as well one which is a little bit more difficult on our website.

http://www.vb-tips.com/default.aspx?...d-faf92f41f563

I hope this helps,

Cor

"Aziz" <az*****@google mail.com> schreef in bericht
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hello, I'm using a DataGrid to add a product to an order. I would like
to fill in a child field (a foreign key) by bringing up a ComboBox
inside the the datagrid cell (like in the latest Northwind database) so
that it shows all available options and I can select the right one.
E.g. in the Orders datagrid I can simply select the product to order by
using a dropdown list

I'm using access 2003 and a VB .NET 2003. I need a solution that is
quick to do and if possible can be done without having to add too much
code (time is short). Thanks.

Apr 13 '06 #2
Thanks. I will give it a try.

Apr 13 '06 #3
Hello,

I'm having the same problem as Azis. I have implemented your code, and
it worked well, except for one thing: if I change the value of the cell
with an item from the combobox, I always get DBNull instead of the
combobox item value:

Dim dt As Datatable
Dim dr As Datarow
Dim o As Object
dt = CType(DGMallen. DataSource, DataView).Table
For Each dr In dt.Rows
o = dr.Item("combo" ) 'o IS ALWAYS DBNULL
End For

Any suggestions?

Thank you very much

Steven

Cor Ligthert [MVP] schreef:
Azis,

There is as well one which is a little bit more difficult on our website.

http://www.vb-tips.com/default.aspx?...d-faf92f41f563

I hope this helps,

Cor

"Aziz" <az*****@google mail.com> schreef in bericht
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hello, I'm using a DataGrid to add a product to an order. I would like
to fill in a child field (a foreign key) by bringing up a ComboBox
inside the the datagrid cell (like in the latest Northwind database) so
that it shows all available options and I can select the right one.
E.g. in the Orders datagrid I can simply select the product to order by
using a dropdown list

I'm using access 2003 and a VB .NET 2003. I need a solution that is
quick to do and if possible can be done without having to add too much
code (time is short). Thanks.


Apr 15 '06 #4
Steven,

It is better to open forever a new question although this seems easier.
Trying to help you.
For Each dr In dt.Rows
o = dr.Item("combo" ) 'o IS ALWAYS DBNULL
End For

I don't understand what you want to do with this.
what is dr.Item("combo" ).

"combo" should be a columnname in your datatable and I don't believe that.

You are in fact just looping through that datatable.

Maybe better that you make a new message. Than somebody else can probably
help you . I stop for today.

Cor
Apr 15 '06 #5

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

Similar topics

4
3578
by: Aaron Ackerman | last post by:
I am using typed datasets in an N-Tier Windows app using VB.NET. I know this posting cannot be fully explained in a single post that is why I am asking for someone to point me to a real world tutorial (in vb.net) that can show me how to use a bound Datagrid to it's fullest potential. I need to utilize the bound Datagrid in two modes. One were a bound Datagrid can be in edited directly utilizing bound combos and textbox right on the grid,...
2
4338
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
2
2713
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update button, seems simple. I am using ALL visual controls (supposedly to simplify things. If I was not using the visual controls and calling an ExecuteNonQuery no prob. Please look at my code and tell me what I am doing wrong. Also, what are the advatages...
1
984
by: acool | last post by:
How does one control the what is entered in a bound DataGrid control? ie: I have an nvarchar field bound to a particular colomn in a Datagrid and i want to be able to control (or check what a user enters in that particular column).
0
945
by: jaYPee | last post by:
i have downloaded an example of a combobox in datagrid from this site http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q480q it works great except that there are some minor problem. this is what i have discover from this sample. when i go to the new row in datagrid with this combobox bound and click the combobox sometimes there is a default value from the value of that combobox and when u click some value it is not changing right...
2
4546
by: jaYPee | last post by:
i have search a lot of newsgroup and some website to find a sample for multi column combobox in datagrid but no luck. there are so many sample i found but it is not located in datagrid. i would be very glad if you can direct me to a website that has this sample thanks in advance.
0
1222
by: Michael C# | last post by:
I have found a few samples of using a combobox in a Datagrid on the Web (Windows Forms). While these examples work well for what they do, I need more functionality, and I'd like some advice on the best way to implement it (if it hasn't already been implemented, that is)... Here's my situation: -I have an ArrayList of Items that need to be bound to the combobox. The ArrayList contains data like this:
10
4704
by: | last post by:
Hi all, Any one know that how to add combobox in datagrid or any 3rd party datagrid can do that.. Thanks
3
4179
by: dsengottuvelu | last post by:
Hi guys, i have Datagrid in VB 6.0, i need to add combobox in Datagrid and fill the combobox values from the database .Can u give any example or websites. Urgent Thanks & Regards Velu
0
1238
by: TonyJ | last post by:
Hello! I'm unsure when I can use a bound datagrid and when I can't. What limitations has a bound datagrid? 1. For example if I want to manipulate the data in the datasource before displaying the data in the datagrid can I then use a bound datagrid? 2. For example if I only want to display some of the columns of a datasource table can I then use a bound datagrid? 3. For example if I some of the columns in a datagrid should be readonly...
0
9699
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
10538
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...
1
10285
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
9115
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...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
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
3792
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.