How to populate a table when BAQ combo box value is selected?

I am currently constructing a dashboard for a client and I need to be able to select a specific bin from a BAQ combo box. In doing so it should populate a table with all the parts in that bin.

Does anyone know how to make the BAQ Combo Box function with a table?

private void yourBAQCombo_ValueChanged_ValueChanged(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **
	if (yourBAQCombo.Value == null)
	{
		GetPartData("NoBin");  // return no results
	}
	else
	{
		string binID = yourBAQCombo.Value.ToString();
		GetPartData(binID);
	}
}

private void GetPartData(string binID)
{
	try
	{ 
		DynamicQueryAdapter yourQueryAdpt = new DynamicQueryAdapter(this.oTrans);
		yourQueryAdpt.BOConnect();
		string yourQueryID = "yourPartBinBAQ"; //
		QueryExecutionDataSet parameters = new QueryExecutionDataSet();
			parameters.ExecutionParameter.AddExecutionParameterRow("binID", binID , "nvarchar", false, Guid.NewGuid(),"A");
		strucQuery.ExecuteByID(queryID, parameters);

		yourPartGrid.DataSource = yourQueryAdpt.QueryResults.Tables["Results"];
	}
	catch (System.Exception ex) 
	{ 
		ExceptionBox.Show(ex); 
	}
}
1 Like