Populate a combobox and display multiple Fields

I am trying to get a combobox to display multiple fields.

	private void PopulateReasonComboBox()
	{
		// 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;
		string whereClause = "ReasonType = 'S' and Scrap = TRUE";
		System.Data.DataSet dsReasonAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "ReasonAdapter", out recSelected, false, whereClause);
		if (recSelected)
		{
			// Set EpiUltraCombo Properties

			this.ucbReasonCd.ValueMember = "ReasonCode";
			this.ucbReasonCd.DataSource = dsReasonAdapter;
			this.ucbReasonCd.DisplayMember = "Description";
			string[] fields = new string[] {"Description"};
			this.ucbReasonCd.SetColumnFilter(fields);
		}
		//ucbReasonCd.ReadOnly = true;
	}

Instead of displaying just Description, I’d like to display ReasonCode | Description
(i.e. S01 | Overshipment)

this.ucbReasonCd.DisplayMember = "Description";
changed to
this.ucbReasonCd.DisplayMember = "ReasonCode | Description";

Any help will be appreciated.

You’ll probably be better off with a BAQ Combo.

Then you can create a calculated field for the display member.

Another option would be to add a column to that dataset dsReasonAdapter and fill it with the proper data.

Got the replies, just haven’t had time to get back in the code. Had to put on my other hat.

That’s a lot of us.

manyhats.Volacci

Of course I wear this one quite often:

8fde3ea2160b8fa9d78379eeeb26de43

I’m wearing the Epicor Programming hat again.

I created the BAQ with the Calculated_DisplayMember.

How do I get access to the BAQ in the customization?

Got it. Did not have to do a BAQ nor UD field

Changed

			string[] fields = new string[] {"Description"};

to

			string[] fields = new string[] {"ReasonCode","Description"};