Fill a epiComboBox from base form Combobox

Hi guys i use this code to fill the an epiUltraCombobox filtered with the values of a base form Combobox but the information is not coming up could you please advise? thanks in advance

private static void SearchOnWarehseAdapterFillDropDown()
{
// Wizard Generated Search Method
// You will need to call this method from another method in custom code
// For example, [Form]_Load or [Button]_Click

	bool recSelected;
	EpiCombo Combo = ((EpiCombo)csm.GetNativeControlReference("2d6cc2de-1547-4f18-907e-e00b44258d55"));
	//EpiMessageBox.Show(Convert.ToString(Combo.Value));
	string whereClause = "Warehse.Plant = '" + Combo.Value.ToString() + "'";
	System.Data.DataSet dsWarehseAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(Script.oTrans, "WarehseAdapter", out recSelected, false, whereClause);
	if (recSelected)
	{
		// Set EpiUltraCombo Properties
		Script.epiUltraComboC1.ValueMember = "WarehouseCode";
		Script.epiUltraComboC1.DataSource = dsWarehseAdapter;
		Script.epiUltraComboC1.DisplayMember = "Description";
		string[] fields = new string[] {"Description"};
		Script.epiUltraComboC1.SetColumnFilter(fields);
	}
}

private static void epiUltraComboC1_ValueChanged(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **
	SearchOnWarehseAdapterFillDropDown();
}

I’m a beginner myself but I don’t see where you are actually loading any
values into your combo

Instead of using an ultra combo and writing all that code, use an EpiRetriverCombo and select Wharehse and let the system do it for you.

1 Like

so i use an epiretreivercombo. does that combobox will retrive all the info filtered by the value of the other combobox?

Chrise when i use these lines i amd loading the values

            Script.epiUltraComboC1.ValueMember = "WarehouseCode";
	Script.epiUltraComboC1.DataSource = dsWarehseAdapter;
	Script.epiUltraComboC1.DisplayMember = "Description";
	string[] fields = new string[] {"Description"};
	Script.epiUltraComboC1.SetColumnFilter(fields);

the retriever combo will return all the values in the WareHse table exactly the same way as the one in the base screen.

the retreiver shows every warehouse i just want to show the warehouses when warehse.plant = Combobox.value in this case i call that object with the guidid

If you want to filter by Plant you can do it a couple of ways, but the easiest way to do it without writing any code is use an BAQCombo
The BAQ Combo runs a BAQ to pupulate the dropdown and you can use BAQ Markup Language to tell it what to filter by

Simply write a BAQ that returns the WareHouseCode and Description then in the Filter in the BAQ Set the filter to
Plant = [EpiBinding:OrderRel.Plant] (or whatever dataview / value you are filtering for)

This tells the BAQ when bound to an BAQComobo or BAQVIew to filter by the view values at OrderRel.Plant found on the given data view.

If you don’t need to filter then you can use the retriever.

Find the BAQ attached that does this
WareHouseFilterByPlant.baq (10.8 KB)

4 Likes

I am getting this error

Message: Key not found: ‘Description’
Parameter name: key
Program: Infragistics4.Shared.v12.2.dll
Method: GetItem

this is how i set the BAQCombobox is there anything i am doing wrong? please advise

never mid i got it thanks for the help really apreciated

1 Like