EpiUltraGrid with EpiUltraCombo as Dropdown

I have an EpiUltraCombo set as the ValueList to a EpiUltraGrid column that is working except the below error is thrown when attempting to type a value into the grid field.

If a value is selected from the dropdown in the grid, it works as expected.
If a value is selected from the EpiUltraCombo that is the ValueList source, it works as expected.
If a value is typed into the EpiUltraCombo, it works as expected.

Error is only generated when typing a value into the grid column.

the EpiUltraCombo datasource is generated from a BAQ.

Code below image.

private void cmbConnection_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs args)
{
	// ** Place Event Handling Code Here **
	DataRow connectionRow = this.edvConnection.CurrentDataRow;
	string pipe = connectionRow["Pipe_c"].ToString();
	DynamicQueryAdapter queryAdapter = new DynamicQueryAdapter(this.oTrans);
	queryAdapter.BOConnect();

	string queryID = "Lookup_Pipe";

	QueryExecutionDataSet parameters = new QueryExecutionDataSet();
	parameters.ExecutionParameter.AddExecutionParameterRow("Pipe", pipe , "string", false, Guid.NewGuid(),"A");
	queryAdapter.ExecuteByID(queryID, parameters);

	if(queryAdapter.QueryResults.Tables["Results"].Rows.Count > 0)
	{
		DataRow pipeRow = queryAdapter.QueryResults.Tables["Results"].Rows[0];
		string odHeight = pipeRow["UD15_ODHeight_c"].ToString();
		string odWidth = pipeRow["UD15_ODWidth_c"].ToString();
		GetConnectionList(odHeight, odWidth);
	}
}

private void GetConnectionList(string odHeight, string odWidth)
{
	try
	{ 
		cmbConnection.DataSource = null;

		DynamicQueryAdapter queryAdapter = new DynamicQueryAdapter(this.oTrans);
		queryAdapter.BOConnect();
	
		string queryID = "Combo_Connection";
	
		QueryExecutionDataSet parameters = new QueryExecutionDataSet();
			parameters.ExecutionParameter.AddExecutionParameterRow("ODHeight", odHeight, "decimal", false, Guid.NewGuid(),"A");
			parameters.ExecutionParameter.AddExecutionParameterRow("ODWidth", odWidth, "decimal", false, Guid.NewGuid(),"A");
		queryAdapter.ExecuteByID(queryID, parameters);
		cmbConnection.DataSource = queryAdapter.QueryResults.Tables["Results"];
	}
	catch (System.Exception ex) 
	{ 
		ExceptionBox.Show(ex); 
	}
}

private void grdConnections_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
{
	// ** Place Event Handling Code Here **
	args.Layout.Bands[0].Columns["Connection_c"].ValueList = cmbConnection;
}
1 Like

Just a guess, but you aren’t getting values from your EpiUltraCombo unless you drop down. It seems that you’d want to do it after you get the odHeight and odWidth instead.

Thanks, Jason. Another issue is the BeforeDropDown method does not get called when clicking the dropdown in the grid field, but is when clicking on the actual UltraCombo. Prior to the ListValue getting populated, text can be entered in the grid field without error, but there is nothing to match. Once the ListValue is populated, the error is received when attempting to enter text. Happens right after the first character is entered. The field is then populated with the first matching value and the method continues to run as expected.

I have also set the ListValue to be populated on a value change of another field (“Pipe_c”), which is required to retrieve the information, so that the dropdown is populated prior to tabbing into the connection dropdown. This works as expected, however the error is thrown when entering text in the UltraGrid field.

I have always used Infragistics.Win.UltraWinGrid.UltraDropDown if I needed a dropdown in a dashboard column to set as ValueList… might be worth having a look at that class?

Perfect, problem solved! Thanks for your help!