Filtering DropDown based on the value of another DropDown

I’m trying to filter a dropdown based on the value selected in another dropdown.
For the most part, I’ve got it, but I cannot get it to just show the DisplayMember instead of the entire dataset. What am I missing?

	private void epiUltraComboC3_ValueChanged(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		EpiUltraCombo pmCombo = (EpiUltraCombo)csm.GetNativeControlReference("2483294d-0d7b-4acf-af96-69c66e12902b");
		EpiUltraCombo letterCombo = (EpiUltraCombo)csm.GetNativeControlReference("bf59928f-d634-426f-ba68-ca51504c3705");
		string letter = letterCombo.Text;

		using(var srA = new SalesRepAdapter(this.oTrans))
		{
			srA.BOConnect();
			
			SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
			opts.NamedSearch.WhereClauses.Add("SalesRep",string.Format("RoleCode='PM' AND InActive=0 AND SalesRepCode LIKE '{0}%'",letter));
	
			bool more = false;
			DataSet ds = srA.GetRows(opts, out more);
			pmCombo.DataSource = ds;
			pmCombo.ValueMember = "SalesRepCode";
			pmCombo.DisplayMember = "Name";
		}
	}

Apparently, you need to force it yerself?
I dunno, but this works.

	private void epiUltraComboC1_ADW_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
	{
		// ** Place Event Handling Code Here **
		UltraGridBand currentBand = args.Layout.Bands[0];

		foreach(UltraGridColumn c in currentBand.Columns)
		{
			if( !c.ToString().Equals("Name") )
				c.Hidden = true; 
		}
	}

I think that the data needs to be in the same view, but this is what I have in a bin drop down that filters by the warehouse. This all set up as a BAQView.

1 Like

Rock on. That might work for the end solution.
I was just playing with some controls that were already on the form which happened to be in different views, but the drop downs in the end solution should be within the same.

1 Like