|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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. Azis,
There is as well one which is a little bit more difficult on our website. http://www.vb-tips.com/default.aspx?ID=1eb83247-7464-467e-a9dd-faf92f41f563 I hope this helps, Cor Show quoteHide quote "Aziz" <aziz***@googlemail.com> schreef in bericht news:1144918217.654024.150620@g10g2000cwb.googlegroups.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. > 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: Show quoteHide quote > Azis, > > There is as well one which is a little bit more difficult on our website. > > http://www.vb-tips.com/default.aspx?ID=1eb83247-7464-467e-a9dd-faf92f41f563 > > I hope this helps, > > Cor > > "Aziz" <aziz***@googlemail.com> schreef in bericht > news:1144918217.654024.150620@g10g2000cwb.googlegroups.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. >> > > Steven,
It is better to open forever a new question although this seems easier. Trying to help you. > For Each dr In dt.Rows I don't understand what you want to do with this.> o = dr.Item("combo") 'o IS ALWAYS DBNULL > End For > 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
Why does Replace return Nothing???
VC6 ATL DLL interop with VB.NET All the king's horses and all the king's men....... Should I use XML as a database for a standalone app? Mail attachment from memory Send email best use of vb.net and multithreading Determine if a File exists Title Bar is visible Call control's event from a collection |
|||||||||||||||||||||||