Solved

Setting the SelectedValue on a combobox

Posted on 2009-05-13
3
707 Views
Last Modified: 2013-12-17
Hi there,

Sorry if this question is quite basic but am pretty new to C#. I have a form which has several combos - the Groups combo is connected to the detail table whose columns are all foreign keys.
The other combo boxes on the form represent a column on this table (which are databound to their respective masters)

I'm trying to set the value of the other combo boxes  based on the value selected in the group combo - on change, i can get the datarow which gives me the id value for each column.

Is there any way i can use the ID value to set the selected value on say the Staff combo?

Thanks!
dsSaphireOra.tblGroupsRow  dr = this.dsSaphireOra.tblGroups.FindByPK_GROUP(cboGroup.SelectedValue);
 
cboStaff.SelectedValue = dr.FK_SALES_STAFF  //Doesn't work!!

Open in new window

0
Comment
Question by:Ignis2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:bprojoe
ID: 24377555
Using the selected value will only work if you are using the combo box's valuemember property when binding the combo box to a dataset, datatable, etc.
0
 

Author Comment

by:Ignis2
ID: 24382571
That's what I think I've done?!
- pls see the attachment!
Combo.jpg
0
 

Accepted Solution

by:
Ignis2 earned 0 total points
ID: 24383049
It worked with a .ToString()!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question