473,325 Members | 2,828 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,325 software developers and data experts.

Associate combobox value with grid

hi, All

I am trying to achieve a simple programming task ie; when the user selects
an item from the comboBox ,the relevant data should be displayed in the
grid. I am using Publisher & Titles tables of Biblo.mdb as an example,
where in Publisher names are displayed in the cmbox and all the titles
related to each are disaplyed in the grid.This is what i am doing but
nothing is displayed in the grid . Can someone advise pl.

'fill the dataset & Create a relation
daPublishers.Fill(dsBiblo, "Publishers")
daTitles.Fill(dsBiblo, "Titles")
dsBiblo.Relations.Add( _
"PubTitles", dsBiblo.Tables("Publishers").Columns("PubID"), _
dsBiblo.Tables("Titles").Columns("PubID"))
cn.Close()
ComboBox1.DisplayMember = "Name"
ComboBox1.ValueMember = "PubID"
ComboBox1.DataSource = dsBiblo.Tables("Publishers")
ComboBox1.DataBindings.Add("SelectedValue", dsBiblo.Tables("Titles"),
"PubID")

gridTitles.DataSource = dsBiblo
gridTitles.DataMember = "publishers.pubTitles" 'using th relation above

TIA
Irfan
Nov 21 '05 #1
1 1165
Irfan

Can you try this one
\\\
GridTitles.SetDataBinding(DsBiblio, "Publishers.PubTitles")
///

And in my opinion can you remove that Databinding from your combobox

I hope this helps,

Cor
Nov 21 '05 #2

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

Similar topics

4
by: Newbee | last post by:
Hola I wanted to kno how to clear the current text that is displayed in my combobox I am filling it with a query which is run against my database I have tried this but it not work ...
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...
3
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:...
5
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound...
6
by: Doug Bell | last post by:
Hi I have a datagrid with a combo box, I need to populate the combo with data dependant on the record value. eg for record 1, field Warehouse = 2R so combo would allow selection of locations...
1
by: Niclas | last post by:
Hi, in ASP .Net, I can associate a value with and item in a dropdown list, for example when binding to a list of employees, I can store the employeeid as a value associated with each name in in...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
3
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a ComboBox with a style that sets its Template and ItemTemplate. I'd like to set the tooltip of the combo to the tooltip of the currently selected item, but I am having trouble...
1
by: SnakesRule | last post by:
I'm trying to pass a name from a ComboBox to a MySQL search function, but no matter how I twist it, the get() always returns the first value in the combobox list, regardless of which name the user...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.