Groups | Blog | Home
all groups > dotnet windows forms databinding > october 2004 >

dotnet windows forms databinding : DataGrid and Combobox problem in WinForms


premchand.peddakotla NO[at]SPAM mckesson.com
10/17/2004 9:31:10 AM
Hi Group,

I am having a problem with datagird and combox box.

Say for ex, I am populating datagrid with dataset that contains table
name "Orders". This table contains one column by name "CustomerName".

I am having one more dataset say "Customers" and I populate the combo
box with the Customer information. DisplayMember is "CustomerName" and
ValueMember is "CustomerId".

Now, when I select a row in datagrid, which contains CustomerName as
"Bill", then the selected index in ComboBox control has to be changed
to "Bill".

How to accomplish this.

blackForest1000 NO[at]SPAM hotmail.com
10/18/2004 12:13:29 AM
Set the property "Text" of the combobox to the Orders - CustomerName column,


[quoted text, click to view]
Sijin Joseph
10/18/2004 9:45:18 AM
Hi Prem,

It would have been easier if both tables had been in the same dataset.
Then you could have set a DataRelation between them and got the desired
effect very easily.

Take a look at these two threads for more info on this topic.
http://groups.google.com/groups?hl=en&lr=&client=firefox-a&threadm=ehHPSWjmEHA.1712%40TK2MSFTNGP09.phx.gbl&rnum=2&prev=/groups%3Fq%3Dlookup%2520table%2520.net%2520sijin%2520joseph%26hl%3Den%26lr%3D%26client%3Dfirefox-a%26sa%3DN%26tab%3Dwg
http://groups.google.com/groups?hl=en&lr=&client=firefox-a&threadm=Ok3cXJ%23nEHA.536%40TK2MSFTNGP11.phx.gbl&rnum=4&prev=/groups%3Fq%3Dlookup%2520table%2520.net%2520sijin%2520joseph%26hl%3Den%26lr%3D%26client%3Dfirefox-a%26sa%3DN%26tab%3Dwg

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

[quoted text, click to view]
AddThis Social Bookmark Button