Linked Drop Down Boxes?

Hi Everyone!
Today I am working on a simple problem with a customized dashboard. I have two comboboxes that I added through form customization. One shows the operation’s Resource Group ID, and the other box shows the resource group description. The goal is to keep these tow drop downs in sync. That way our end users can choose the resource by either typing in the description drop down, or typing in the ID drop down.

I started this using the combo box event “ValueChanged”. This is what I have, and it looks like it should work. However, when I choose a value in the description box, the id box does not change. Conversely, if I change the resource id box, then the description box does in fact get updated correctly.

	private void MyResourceID_ValueChanged(object sender, System.EventArgs args)
		// ** Place Event Handling Code Here **
		//MessageBox.Show("MyResourceID:" + MyResourceID.Value.ToString());
		//MessageBox.Show("MyResourceDesc: " + MyResourceDesc.Value.ToString());
		MyResourceDesc.Value= MyResourceID.Value;

	private void MyResourceDesc_ValueChanged(object sender, System.EventArgs args)
		// ** Place Event Handling Code Here **
		//MessageBox.Show("MyResourceID:" + MyResourceID.Value.ToString());
		//MessageBox.Show("MyResourceDesc: " + baqCombo1.Value.ToString());
		MyResourceID.Value = MyResourceDesc.Value;

How can I keep these two drop downs in sync so the value from one is always the value in the other?
Thanks for your time!

Have you already seen this?

I’m not positive the examples in the thread can be applied to your specific problem.
Just remembered some of the info in that had helped me with a similar combo project.

If not, let me know & I should be able to dig up another example of a custom form where I’m syncing multiple comboboxes on a custom form, all via code. It’s not pretty but it worked.

I think the basics for this is covered in the ICE Customization Guide.

Interestingly, if I choose the code from MyResourceID first, then both boxes populate correctly and then begin acting correctly, where I can set the value of both boxes from either drop down.

If I want to start the form and choose my resource description first, then the value never populates and never updates the other drop down. I can see the list of resource descriptions in the drop down, but choosing one does not seem to set the value (or trigger the value changed event.)

I have read through the ICE and Customization guides but couldn’t find anything useful there. This really seems like its almost working and I just missed a step.

Hmmm… I didn’t notice this on the first reading.
Just want to make sure I understand, you saying you have two separate combos on the dashboard for the same table - ResourceGrps?
Where one combo list displays the ID while the other displays the description?
So if either combo has an item selected, you want the other to combo to update?

Yes. Exactly. The drop down boxes are baqCombos based on a custom baq I made to return the eligible resourcegroupids and descriptions.

OK, sorry I originally thought you had a simple parent/child setup.

This won’t apply directly but… here is a zip with an old parent/child example anyway.
Maybe some of the combo “bits” in there might be useful to you.
Note it’s pretty (very) ugly…someone else did the original parent/child combos, I was asked much later to tack on that third level of combos. Looking back, one of those things that probably should have just rebuilt from scratch. (94.8 KB)

Thank you for posting. I don’t think I need anything that complicated. This approach I am on almost works. Its just a matter of figuring out the timing and the events.

It seems like this problem is related to the order that things are loaded on the form. In my case, the dashboard loads, and then fires the BAQ. This triggers the user parameter input. Once the user supplies the part number as a parameter, the BAQ returns all the parts and revs.

It looks like the drop down doesn’t populate until I click on the drop down icon. Once it is populated, all my code works as expected.

What can I do to populate the drop down as soon as the baq returns the parameter-based results to the dashboards epigrid?

I added .ForceRefreshList(); to the before row change and it seems to be working like I wanted!

If those fields are bound to a field (which I assume they are) why not just make your life easy and do an after field changed event so that After Field 1 Changes, Set Field 2 = Field 1 and vise versa.

In this case they are not bound to an epi field. They are unbound empty text boxes.