473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 5190
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*****@googlemail.com> schreef in bericht
news:11**********************@g10g2000cwb.googlegr oups.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*****@googlemail.com> schreef in bericht
news:11**********************@g10g2000cwb.googlegr oups.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
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...
2
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...
2
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...
1
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...
0
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...
2
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...
0
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...
10
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
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
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.