Dynamic Query Value

I have a Dashboard that I search for a partial PONum. On field leave, I create a Dynamic Query to display the BAQ results. I then need to be able to select a record in the Dynamic Query Grid and have the PONum field repopulate with the full PONum. How would I tell it the field to populate with?
My code

	private void txtOrderHed_PONum_Leave(object sender, System.EventArgs args)
	{
	numOrderDtl_OrderNum.Value = (0);
	numOrderDtl_OrderLine.Value = (0);
	numOrderDtl_TotalReleases.Value = (0);
	epiTextBoxPORefNum.Text = txtOrderHed_PONum.Text;
	DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
	dqa.BOConnect();
	QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Order_Detail_ParamsPO");
	qeds.ExecutionParameter.Clear();
	qeds.ExecutionParameter.AddExecutionParameterRow("POParam", epiTextBoxPORefNum.Text, "nvarchar", false, Guid.NewGuid(), "A");
	dqa.ExecuteByID("GS_Order_Detail_ParamsPO", qeds);
	gridPOResults.DataSource = dqa.QueryResults.Tables["Results"];```

Easiest way is to use a wizard to put a RowChange event handler on that grid. In there, you have something like

yourponumbox.value = args.Cell.Row.Cells["column"].Value;

I tried this and I am getting an error:

private void gridPOResults_AfterRowActivate(object sender, System.EventArgs args)
	{
		epiTextBoxPORefNum.Text = args.Cell.Row.Cells["OrderHed_PONum"].Text;
	}```
![image|552x190](upload://wFqQce7eCPe7LNlap0PUuXM3n1c.png)

You should have this (value instead of text on the Cells). I did not look at this too close but you might be better off using a Search Function for this.

epiTextBoxPORefNum.Text = args.Cell.Row.Cells["OrderHed_PONum"].Value;

I tried that too and I am getting the same error about no definition for Cell. Do I need to say using Something at the beginning of my code?

Can you post your full code?

// **************************************************
 //Custom code for MainController
 //Created: 9/15/2018 11:34:11 AM
 //**************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
//using Ice.UltraWinGrid;

public class Script
{
	//** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	//Begin Wizard Added Module Level Variables **
	//End Wizard Added Module Level Variables **
	//Add Custom Module Level Variables Here **
private string custid;
private int ordernum;
private int orderline;
private int qty;
private int quoteqty;
private int numcolors; 
private string quotepartnum;
private string partnum;
private int quotenum;
private int newquoteqty;
private string newquotepartnum;
private int newnumcolors;
private int newqtybreaks;
private string newcustid;
private int neworderqty;
private string neworderpartnum;
private int ordernumcolors;
private int neworderqtybreaks;
private string ordercustid;
private int newordernum;
private int neworderline;
private EpiTextBox txtOrderDtl_PartNum;
private EpiTextBox txtCustomer_CustID3; 
private EpiNumericEditor numOrderDtl_OrderLine;
private EpiTextBox txtOrderHed_PONum;
private EpiTextBox txtOrderDtl_GS_ImprintCopy_c;
private EpiPanel V_GS_Order_Detail_All_1ViewDetailPanel1;
private EpiNumericEditor numQuoteDtl_QuoteNum;
private EpiNumericEditor numOrderDtl_OrderNum;
private EpiTextBox txtCustomer_CustID;
private EpiTextBox txtCustomer_CustID2;
private EpiNumericEditor numOrderDtl_OrderQty;
private EpiNumericEditor numOrderDtl_GS_NbrOfColors_c;
private EpiNumericEditor numInvcHead_OrderNum;
private EpiNumericEditor numInvcHead_InvoiceNum;
private EpiDataView edvV_GS_CustomerSearch_1View;
private DataView V_GS_Order_Detail_All_1View_DataView;
private EpiDataView edvV_GS_Order_Detail_All_1View;
private EpiDataView edvV_GS_Quotes_1View;
private EpiDataView edvV_GS_Invoices_1View;
private EpiNumericEditor numCustomer_CustNum;
private System.Windows.Forms.WebBrowser wbSite; //Reference New Browser Object Website
private EpiNumericEditor numOrderDtl_TotalReleases;

	public void InitializeCustomCode()
	{
		 //** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		 //Begin Wizard Added Variable Initialization

		 //End Wizard Added Variable Initialization

		 //Begin Wizard Added Custom Method Calls
		this.V_GS_Order_Detail_All_1View_Row.EpiRowChanged += new EpiRowChanged(this.V_GS_Order_Detail_All_1View_AfterRowChange);
		this.V_GS_CustomerSearch_1View_Row.EpiRowChanged += new EpiRowChanged(this.V_GS_CustomerSearch_1View_AfterRowChange);
		this.edvV_GS_Order_Detail_All_1View = ((EpiDataView)(this.oTrans.EpiDataViews["V_GS_Order_Detail_All_1View"]));
		this.edvV_GS_Order_Detail_All_1View.EpiViewNotification += new EpiViewNotification(this.edvV_GS_Order_Detail_All_1View_EpiViewNotification);
		this.edvV_GS_Quotes_1View = ((EpiDataView)(this.oTrans.EpiDataViews["V_GS_Quotes_1View"]));
		this.edvV_GS_CustomerSearch_1View = ((EpiDataView)(this.oTrans.EpiDataViews["V_GS_CustomerSearch_1View"]));
		this.edvV_GS_CustomerSearch_1View.EpiViewNotification += new EpiViewNotification(this.edvV_GS_CustomerSearch_1View_EpiViewNotification);	
		epiNumericEditorOrderLineNo = (EpiNumericEditor)csm.GetNativeControlReference("4b377693-8a86-4f9f-988b-d44862bcb3dd");
		numCustomer_CustNum = (EpiNumericEditor)csm.GetNativeControlReference("ad61efeb-c259-4700-bd9e-d4ac0be68efb");		
		numOrderDtl_OrderQty = (EpiNumericEditor)csm.GetNativeControlReference("912b6872-a423-4d21-bc7e-f223d262ca5d");
		numOrderDtl_GS_NbrOfColors_c = (EpiNumericEditor)csm.GetNativeControlReference("fb8c08ba-9289-4d12-92e1-ed82b9f19e6d");
		txtCustomer_CustID = (EpiTextBox)csm.GetNativeControlReference("b1f04d95-6ac9-45da-a929-e650058f13bc");
		txtCustomer_CustID2 = (EpiTextBox)csm.GetNativeControlReference("bd16b76f-fc71-4b78-bb6d-8ec7cedc1338");	
		numQuoteDtl_QuoteNum = (EpiNumericEditor)csm.GetNativeControlReference("cda1ff1f-11c3-4a3d-bd6e-5f684a9107b2");
		txtOrderDtl_GS_ImprintCopy_c = (EpiTextBox)csm.GetNativeControlReference("bf50390a-fe73-4caf-aeec-d23e401e6899");
		txtOrderHed_PONum = (EpiTextBox)csm.GetNativeControlReference("3e06f070-8be5-4c87-8cd9-413463a26382");
		numOrderDtl_OrderLine = (EpiNumericEditor)csm.GetNativeControlReference("74100544-e769-4d3a-b4b8-074eb4d4969e");
		numOrderDtl_OrderNum = (EpiNumericEditor)csm.GetNativeControlReference("fff3b987-034b-440f-a55c-7f8fd3c44853");
		txtOrderDtl_PartNum = (EpiTextBox)csm.GetNativeControlReference("e9a1f245-a0dc-497c-81b9-8b1b35adf74a");
		txtCustomer_CustID3 = (EpiTextBox)csm.GetNativeControlReference("f69b6575-a461-4c07-a660-bbabb7da63f5");
		numOrderDtl_TotalReleases = (EpiNumericEditor)csm.GetNativeControlReference("2a1053cd-593c-41d5-8c74-e0026524b06f");
		grid_QuoteLetterPrev = (EpiUltraGrid)csm.GetNativeControlReference("2c21a74b-e009-4d50-a7d7-9442c68eba4c");
		this.btn_QuoteFromOrder.Click += new System.EventHandler(this.btn_QuoteFromOrder_Click);
		this.btn_SalesOrderSearch.Click += new System.EventHandler(this.btn_SalesOrderSearch_Click);
		this.btnQS_NewQuote.Click += new System.EventHandler(this.btnQS_NewQuote_Click);
		this.btnQS_CustID.Click += new System.EventHandler(this.btnQS_CustID_Click);
		this.btnQS_Part.Click += new System.EventHandler(this.btnQS_Part_Click);
		this.btn_QS_Num1.Click += new System.EventHandler(this.btn_QS_Num1_Click);
		this.btn_QS_editquo1.Click += new System.EventHandler(this.btn_QS_editquo1_Click);
		this.btnExpediting.Click += new System.EventHandler(this.btnExpediting_Click);
		this.btnOrderQuickNotes.Click += new System.EventHandler(this.btnOrderQuickNotes_Click);
		this.btnCreateNon_Conformance.Click += new System.EventHandler(this.btnCreateNon_Conformance_Click);
		this.epiTextQS_CustID.Leave += new System.EventHandler(this.epiTextQS_CustID_Leave);
		this.numOrderDtl_OrderLine.Leave += new System.EventHandler(this.numOrderDtl_OrderLine_Leave);
		this.txtOrderHed_PONum.Leave += new System.EventHandler(this.txtOrderHed_PONum_Leave);
		this.txtCustomer_CustID.Leave += new System.EventHandler(this.txtCustomer_CustID_Leave);
		this.numQuoteDtl_QuoteNum.Leave += new System.EventHandler(this.numQuoteDtl_QuoteNum_Leave);
		this.btn_Cust_CustID.Click += new System.EventHandler(this.btn_Cust_CustID_Click);
		this.btnQuoteClearForm.Click += new System.EventHandler(this.btnQuoteClearForm_Click);
		this.btnOrderView.Click += new System.EventHandler(this.btnOrderView_Click);
		this.btnShipstore.Click += new System.EventHandler(this.btnShipstore_Click);
		this.btnChangeShipping.Click += new System.EventHandler(this.btnChangeShipping_Click);
		this.btnQuickNoteLaunch.Click += new System.EventHandler(this.btnQuickNoteLaunch_Click);
		this.numOrderDtl_OrderLine.GotFocus += new System.EventHandler(this.numOrderDtl_OrderLine_GotFocus);
		//this.gridPOResults.AfterSelectChange += new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.gridPOResults_AfterSelectChange);
		this.gridPOResults.AfterRowActivate += new System.EventHandler(this.gridPOResults_AfterRowActivate);
SetupBrowser_enFlow();
		//End Wizard Added Custom Method Calls
	}

	public void DestroyCustomCode()
	{
		 //** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		 //Begin Wizard Added Object Disposal
	
		 //End Wizard Added Object Disposal

		 //Begin Custom Code Disposal
		this.V_GS_CustomerSearch_1View_Row.EpiRowChanged -= new EpiRowChanged(this.V_GS_CustomerSearch_1View_AfterRowChange);
		this.V_GS_Order_Detail_All_1View_Row.EpiRowChanged -= new EpiRowChanged(this.V_GS_Order_Detail_All_1View_AfterRowChange);
		this.btn_QuoteFromOrder.Click -= new System.EventHandler(this.btn_QuoteFromOrder_Click);
		this.edvV_GS_Order_Detail_All_1View.EpiViewNotification -= new EpiViewNotification(this.edvV_GS_Order_Detail_All_1View_EpiViewNotification);
		this.edvV_GS_Order_Detail_All_1View = null;
		this.btnQS_NewQuote.Click -= new System.EventHandler(this.btnQS_NewQuote_Click);
		this.btnQS_CustID.Click -= new System.EventHandler(this.btnQS_CustID_Click);
		this.btnQS_Part.Click -= new System.EventHandler(this.btnQS_Part_Click);
		this.btn_QS_Num1.Click -= new System.EventHandler(this.btn_QS_Num1_Click);
		this.btn_QS_editquo1.Click -= new System.EventHandler(this.btn_QS_editquo1_Click);
		this.btnChangeShipping.Click -= new System.EventHandler(this.btnChangeShipping_Click);
		this.btnExpediting.Click -= new System.EventHandler(this.btnExpediting_Click);
		this.btnOrderQuickNotes.Click -= new System.EventHandler(this.btnOrderQuickNotes_Click);
		this.epiTextQS_CustID.Leave -= new System.EventHandler(this.epiTextQS_CustID_Leave);
		this.txtCustomer_CustID.Leave -= new System.EventHandler(this.txtCustomer_CustID_Leave);
		this.txtOrderHed_PONum.Leave -= new System.EventHandler(this.txtOrderHed_PONum_Leave);
		this.btnCreateNon_Conformance.Click -= new System.EventHandler(this.btnCreateNon_Conformance_Click);
		this.edvV_GS_Quotes_1View = null;
		this.btn_Cust_CustID.Click -= new System.EventHandler(this.btn_Cust_CustID_Click);
		this.btnQuoteClearForm.Click -= new System.EventHandler(this.btnQuoteClearForm_Click);
		this.edvV_GS_CustomerSearch_1View.EpiViewNotification -= new EpiViewNotification(this.edvV_GS_CustomerSearch_1View_EpiViewNotification);
		this.edvV_GS_CustomerSearch_1View = null;
		this.btnOrderView.Click -= new System.EventHandler(this.btnOrderView_Click);
		this.btnShipstore.Click -= new System.EventHandler(this.btnShipstore_Click);
		this.btnQuickNoteLaunch.Click -= new System.EventHandler(this.btnQuickNoteLaunch_Click);
		this.numOrderDtl_OrderLine.GotFocus -= new System.EventHandler(this.numOrderDtl_OrderLine_GotFocus);
		this.gridPOResults.AfterRowActivate -= new System.EventHandler(this.gridPOResults_AfterRowActivate);
		//this.gridPOResults.AfterSelectChange -= new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.gridPOResults_AfterSelectChange);
		SetupBrowser_enFlow();
		//End Custom Code Disposal
	
	}

//Customer Section Code Begins*********
//Customer ID Search Button in Customer Section
	private void btn_Cust_CustID_Click(object sender, System.EventArgs args)
	{
		SearchOnCustomerAdapterShowDialog_1();
	}


//Customer ID Search Method in Customer Section
	private void SearchOnCustomerAdapterShowDialog_1()
	{
		 //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 = string.Empty;
		System.Data.DataSet dsCustomerAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "CustomerAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			System.Data.DataRow adapterRow = dsCustomerAdapter.Tables[0].Rows[0];

			// Map Search Fields to Application Fields
			txtCustomer_CustID.Text = adapterRow["CustID"].ToString();
			epiTextCustNumRef.Text = adapterRow["CustID"].ToString();
			changecustomernumber();
		}
	}

//Customer - Refreshes Customer View and Populates Grids
	private void changecustomernumber()
	{
	epiTextCustNumRef.Text = txtCustomer_CustID.Text;
	//Customer Detail Grid That is Hidden From View
	DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
	dqa.BOConnect();
	QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Customer_Search_Param");
	qeds.ExecutionParameter.Clear();
	qeds.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextCustNumRef.Text , "nvarchar", false, Guid.NewGuid(), "A");
	dqa.ExecuteByID("GS_Customer_Search_Param", qeds);
	grid_Cust_Search_Parms.DataSource = dqa.QueryResults.Tables["Results"];
	edvV_GS_CustomerSearch_1View.ResetDataView(dqa.QueryResults.Tables["Results"].DefaultView);
    edvV_GS_CustomerSearch_1View.Notify(new EpiNotifyArgs(oTrans, 0, EpiTransaction.NotifyType.Initialize));
	//Customer Attributes Grid
	DynamicQueryAdapter dqa1 = new DynamicQueryAdapter(oTrans);
	dqa1.BOConnect();
	QueryExecutionDataSet qeds1 = dqa1.GetQueryExecutionParametersByID("GS_Customer_Attributes");
	qeds1.ExecutionParameter.Clear();
	qeds1.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextCustNumRef.Text , "nvarchar", false, Guid.NewGuid(), "B");
	dqa1.ExecuteByID("GS_Customer_Attributes", qeds1);
	epiUltraGridC3.DataSource = dqa1.QueryResults.Tables["Results"];
	//Customer Contacts Grid
	DynamicQueryAdapter dqa2 = new DynamicQueryAdapter(oTrans);
	dqa2.BOConnect();
	QueryExecutionDataSet qeds2 = dqa2.GetQueryExecutionParametersByID("GS_Customer_Contacts");
	qeds2.ExecutionParameter.Clear();
	qeds2.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextCustNumRef.Text , "nvarchar", false, Guid.NewGuid(), "C");
	dqa2.ExecuteByID("GS_Customer_Contacts", qeds2);
	epiUltraGridC2.DataSource = dqa2.QueryResults.Tables["Results"];
	MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));	
}

//Customer - On Leave Refreshes the View and Grids
	private void txtCustomer_CustID_Leave(object sender, System.EventArgs args)
	{
		changecustomernumber();
	}

//Customer - Quick Note Launch Button - Popup Window
	private void btnQuickNoteLaunch_Click(object sender, System.EventArgs args)
	{
		System.Diagnostics.Process.Start("http://envisionpp/erpdashboard/quickNoteStart.asp?custnum=" + numCustomer_CustNum.Value.ToString());
	}


//**********************Order Section Code Begins*********
	
//Order - Button Search for Sales Order Number in Orders Section
	private void btn_SalesOrderSearch_Click(object sender, System.EventArgs args)
	{
		SearchOnSalesOrderAdapterShowDialog();
	}

//Order - Method for Sales Order Search in Orders Section
	private void SearchOnSalesOrderAdapterShowDialog() 
	{
		 //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 = string.Empty;
		System.Data.DataSet dsSalesOrderAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "SalesOrderAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			System.Data.DataRow adapterRow = dsSalesOrderAdapter.Tables[0].Rows[0];
			 //Map Search Fields to Application Fields
			numOrderDtl_OrderNum.Value = adapterRow["OrderNum"];
			epiNumericOrderNumRef.Value = adapterRow["OrderNum"];
			epiTextBoxPORefNum.Text = adapterRow["PONum"].ToString();
			changeordernumber();
		}
	}

//Order - Refreshes Order View and Populates Grids
	private void changeordernumber()
	{
	
	//Order Detail Grid That is Hidden From View
	/*DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
	dqa.BOConnect();
	QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Order_Detail_Params");
	qeds.ExecutionParameter.Clear();
	qeds.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "C");
	dqa.ExecuteByID("GS_Order_Detail_Params", qeds);
	grid_OrderDetails.DataSource = dqa.QueryResults.Tables["Results"];
	edvV_GS_Order_Detail_All_1View.ResetDataView(dqa.QueryResults.Tables["Results"].DefaultView);
    edvV_GS_Order_Detail_All_1View.Notify(new EpiNotifyArgs(oTrans, 0, EpiTransaction.NotifyType.Initialize));*/
	//Order Movement All Tab
	epiNumericOrderNumRef.Value = numOrderDtl_OrderNum.Value;
	DynamicQueryAdapter dqa4 = new DynamicQueryAdapter(oTrans);
	dqa4.BOConnect();
	QueryExecutionDataSet qeds4 = dqa4.GetQueryExecutionParametersByID("GS_UD09_Movement_All");
	qeds4.ExecutionParameter.Clear();
	qeds4.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "D");
	dqa4.ExecuteByID("GS_UD09_Movement_All", qeds4);
	grid_MovementforOrder2.DataSource = dqa4.QueryResults.Tables["Results"];
	//Order Misc Charges
	DynamicQueryAdapter dqa5 = new DynamicQueryAdapter(oTrans);
	dqa5.BOConnect();
	QueryExecutionDataSet qeds5 = dqa5.GetQueryExecutionParametersByID("GS_Misc_Charges");
	qeds5.ExecutionParameter.Clear();
	qeds5.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "E");
	dqa5.ExecuteByID("GS_Misc_Charges", qeds5);
	grid_MiscCharges.DataSource = dqa5.QueryResults.Tables["Results"];
	//Order Movement Last
	DynamicQueryAdapter dqa6 = new DynamicQueryAdapter(oTrans);
	dqa6.BOConnect();
	QueryExecutionDataSet qeds6 = dqa6.GetQueryExecutionParametersByID("GS_UD09_Movement");
	qeds6.ExecutionParameter.Clear();
	qeds6.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "F");
	dqa6.ExecuteByID("GS_UD09_Movement", qeds6);
	grid_LastMovement.DataSource = dqa6.QueryResults.Tables["Results"];
	//Order Attachments
	DynamicQueryAdapter dqa7 = new DynamicQueryAdapter(oTrans);
	dqa7.BOConnect();
	QueryExecutionDataSet qeds7 = dqa7.GetQueryExecutionParametersByID("GS_Attachments");
	qeds7.ExecutionParameter.Clear();
	qeds7.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "G");
	dqa7.ExecuteByID("GS_Attachments", qeds7);
	grid_Attachments.DataSource = dqa7.QueryResults.Tables["Results"];
	foreach (System.Data.DataRow r in dqa7.QueryResults.Tables["Results"].Rows)
		{
		epiTextBoxOrderNoAttach.Text = r["XFileRef_XFileName"].ToString();
		epiTextBoxOrderNoDesc.Text = r["XFileRef_XFileDesc"].ToString();
		}
	SetupBrowser_Attachments();
	epiTextBoxPORefNum.Text = txtOrderHed_PONum.Text;
	MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));	
}

//Order - enFlow Queue
 public void SetupBrowser_enFlow()
	{
		wbSite = new System.Windows.Forms.WebBrowser();
		wbSite.Dock = System.Windows.Forms.DockStyle.Fill;
		wbSite.Location = new System.Drawing.Point(0,0);
		wbSite.MinimumSize = new System.Drawing.Size(20,20);
		wbSite.Name = "enFlow";
		wbSite.Size = new System.Drawing.Size(560,323);
		wbSite.TabIndex = 0;
		epiGroupBoxOrderEnflowQueue.Controls.Add(wbSite);
		wbSite.Navigate("http://envisionpp/workflow/enflowview.asp?&Order=100169&nohead=Y");
}      

//Order - Attachments
 public void SetupBrowser_Attachments()
	{
		wbSite = new System.Windows.Forms.WebBrowser();
		wbSite.Dock = System.Windows.Forms.DockStyle.Fill;
		wbSite.Location = new System.Drawing.Point(0,0);
		wbSite.MinimumSize = new System.Drawing.Size(20,20);
		wbSite.Name = "Attachments";
		wbSite.Size = new System.Drawing.Size(560,323);
		wbSite.TabIndex = 0;
		epiGroupBoxAttachments.Controls.Add(wbSite);
		//wbSite.Navigate ("http://Intranet/ART/2018/05/9433501_ga.pdf");
		wbSite.DocumentText = epiTextBoxOrderNoAttach.Text.ToString();
}  

//Order Focus on Sheet
	private void numOrderDtl_OrderLine_GotFocus(object sender, System.EventArgs args)
{
	this.numOrderDtl_OrderLine.GotFocus += new System.EventHandler(this.numOrderDtl_OrderLine_GotFocus);

}
//Order - PONum Leave
	private void txtOrderHed_PONum_Leave(object sender, System.EventArgs args)
	{
	gridPOResults.Visible = true; //Show PO Grid
	numOrderDtl_OrderNum.Value = (0);
	numOrderDtl_OrderLine.Value = (0);
	numOrderDtl_TotalReleases.Value = (0);
	epiTextBoxPORefNum.Text = txtOrderHed_PONum.Text;
	DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
	dqa.BOConnect();
	QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Order_Detail_ParamsPO");
	qeds.ExecutionParameter.Clear();
	qeds.ExecutionParameter.AddExecutionParameterRow("POParam", epiTextBoxPORefNum.Text, "nvarchar", false, Guid.NewGuid(), "A");
	dqa.ExecuteByID("GS_Order_Detail_ParamsPO", qeds);
	gridPOResults.DataSource = dqa.QueryResults.Tables["Results"];
	edvV_GS_Order_Detail_All_1View.ResetDataView(dqa.QueryResults.Tables["Results"].DefaultView);
    edvV_GS_Order_Detail_All_1View.Notify(new EpiNotifyArgs(oTrans, 0, EpiTransaction.NotifyType.Initialize));
	changeordernumber();
	//SetupBrowser_Attachments();*/
	MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));	
}

//Order - On Leave Refreshes the View and Grids
	private void numOrderDtl_OrderLine_Leave(object sender, System.EventArgs args)
	{
		gridPOResults.Visible = false; //Hide PO Grid
		txtOrderHed_PONum.Text = string.Empty;
		epiNumericOrderNumRef.Value = numOrderDtl_OrderNum.Value;
		epiNumericEditorOrderLineNo.Value = numOrderDtl_OrderLine.Value;
		DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
		dqa.BOConnect();
		QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Order_Detail_Params");
		qeds.ExecutionParameter.Clear();
		qeds.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "C");
		dqa.ExecuteByID("GS_Order_Detail_Params", qeds);
		grid_OrderDetails.DataSource = dqa.QueryResults.Tables["Results"];
		edvV_GS_Order_Detail_All_1View.ResetDataView(dqa.QueryResults.Tables["Results"].DefaultView);
    	edvV_GS_Order_Detail_All_1View.Notify(new EpiNotifyArgs(oTrans, 0, EpiTransaction.NotifyType.Initialize));
		changeordernumber();
		this.numOrderDtl_OrderLine.GotFocus += new System.EventHandler(this.numOrderDtl_OrderLine_GotFocus);
		MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));	
	}

//Order - Quote From ORDER in Orders Section
	private void btn_QuoteFromOrder_Click(object sender, System.EventArgs args)
	{	
	LaunchFormOptions lfo = new LaunchFormOptions();
	lfo.IsModal = false;
	lfo.SuppressFormSearch = true;
	System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
	mylist.Add("entitynum", "0"); 
	neworderpartnum = txtOrderDtl_PartNum.Text;
	mylist.Add("partnum", neworderpartnum.ToString()); 
	neworderqty = Convert.ToInt32(numOrderDtl_OrderQty.Value);
	mylist.Add("quantity", neworderqty.ToString()); 
	ordercustid = txtCustomer_CustID2.Text;
	mylist.Add("custid", ordercustid); 
	//neworderqtybreaks = Convert.ToInt32(epiNumericEditorC2OrderQtyBreak.Text);
	mylist.Add("quantitybreaks", "3");
	ordernumcolors = Convert.ToInt32(numOrderDtl_GS_NbrOfColors_c.Value);
	mylist.Add("numofcolors", ordernumcolors.ToString()); 
	newordernum = Convert.ToInt32(epiNumericEditorC1OrderNum.Text);
	mylist.Add("prevorder", newordernum.ToString());
	neworderline = Convert.ToInt32(epiNumericEditorC2OrderLine.Text);
	mylist.Add("prevorderline", neworderline.ToString());
	mylist.Add("actiontype", "NewQuote"); 
	string valuein = "Quote";
	lfo.ValueIn = valuein;
	lfo.ContextValue = mylist;
	//MessageBox.Show(ordernum.ToString() + ", " + orderline.ToString()+ "," + ordercustid.ToString() + "," + "ButtonC1Launch, " + ", " + neworderqty + ", " + ordernumcolors.ToString());
	ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo); 
	}

//Order - Create Non-Conformance
	private void btnCreateNon_Conformance_Click(object sender, System.EventArgs args)
	{
	LaunchFormOptions lfo = new LaunchFormOptions();
	lfo.IsModal = false;
	lfo.SuppressFormSearch = true;
	System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
	mylist.Add("CustID", txtCustomer_CustID.Text); 
	//mylist.Add("CustID", "03061982");
	mylist.Add("RMANum", "0");
	mylist.Add("OrderNum", "1411");
	mylist.Add("OrderLine", "1");
	mylist.Add("OrderRel", "1");
	mylist.Add("actiontype", "NewRMA"); 
	string valuein = "RMA";	
	lfo.ValueIn = valuein;
	lfo.ContextValue = mylist;
	MessageBox.Show("ButtonC1Launch", txtCustomer_CustID.Text);
	ProcessCaller.LaunchForm(oTrans, "CRGO5000", lfo); 
	}
	
//Order - PO Grid Refreshes Text Box
private void gridPOResults_AfterRowActivate(object sender, System.EventArgs args)
	{
		//epiTextBoxPORefNum.Text = gridPOResults.Row.OrderHed_PONum.Text;
		epiTextBoxPORefNum.Text = "cab123456";
		//epiTextBoxPORefNum.Text = args.Cell.Row.Cells["OrderHed_PONum"].Value;
	}

//Order - View Order in Configurator - Janice hasn't made Call for this yet. 
	private void btnOrderView_Click(object sender, System.EventArgs args)
	{
	LaunchFormOptions lfo = new LaunchFormOptions();
	string valuein = "Order";
	newordernum = Convert.ToInt32(epiNumericEditorC1OrderNum.Text);
	string contextvaluein = newordernum.ToString();
	lfo.ValueIn = valuein;
	lfo.ContextValue = contextvaluein;
	ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo); 
	}     

//Launch Epicor URL - Any Area
private void LaunchURL(string url, string title = "", int padding = 65)
{
	Ice.Lib.Customization.CustomWebBrowserDialog uiWebBrowser = new Ice.Lib.Customization.CustomWebBrowserDialog();
	Ice.Lib.Framework.EpiBaseForm f = (Ice.Lib.Framework.EpiBaseForm)csm.PersonalizeCustomizeManager.TopControl.FindForm();
   uiWebBrowser.Width = f.Width - padding;
   uiWebBrowser.Height = f.Height - padding;
   uiWebBrowser.Text = title;
   uiWebBrowser.HomeURL = url;
   uiWebBrowser.StartPosition = FormStartPosition.CenterScreen; // If you don't center you can use .Top and .Left
   uiWebBrowser.Show();
   uiWebBrowser.OnRefresh(); // Loads URL
}
 	
//Order - Shipstore Button URL Launch
private void btnShipstore_Click(object sender, System.EventArgs args)
	{
		System.Diagnostics.Process.Start("http://shipstore.gill-line.com/Prod/");
	}

//Order - Order Change Shipping Button URL Launch
private void btnChangeShipping_Click(object sender, System.EventArgs args)
	{
		System.Diagnostics.Process.Start("http://envisionpp/workflow/workflow.asp?wftypeid=18&nohead=Y&ischild=Y&ordernum=" + numOrderDtl_OrderNum.Value.ToString());
	}

//Order - Change Shipping Method Button
private void btnOrderQuickNotes_Click(object sender, System.EventArgs args)
	{
		System.Diagnostics.Process.Start("http://envisionpp/erpdashboard/quickNoteStart.asp?order=" + numOrderDtl_OrderNum.Value.ToString() + "&line=" + numOrderDtl_OrderLine.Value.ToString());
	}

//Order - Expediting Button URL Launch
	private void btnExpediting_Click(object sender, System.EventArgs args)
	{
		System.Diagnostics.Process.Start("http://envisionpp/workflow/workflow.asp?wftypeid=6&nohead=Y&ischild=Y&ordernum=" + numOrderDtl_OrderNum.Value.ToString() + "&orderline=" + numOrderDtl_OrderLine.Value.ToString());
	}


//**********************QUOTE Section Code Begins **********
	
//Quote - Customer ID Search in the Create New Quote Section
	private void btnQS_CustID_Click(object sender, System.EventArgs args)
	{
		SearchOnCustomerAdapterShowDialog_2();
	}

//Quote - Customer ID Search Method in the Create New Quote Section
	private void SearchOnCustomerAdapterShowDialog_2()
	{
		 //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 = string.Empty;
		System.Data.DataSet dsCustomerAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "CustomerAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			System.Data.DataRow adapterRow = dsCustomerAdapter.Tables[0].Rows[0];
			// Map Search Fields to Application Fields
		{
			epiTextQS_CustID.Text = adapterRow["CustID"].ToString();
		}
	}
}

//Quote - Part Search in Create New Quote Section
	private void btnQS_Part_Click(object sender, System.EventArgs args)
	{
		SearchOnPartAdapterShowDialog_1();
	}
	
//Quote - Part Search Method in Create New Quote Section	
	private void SearchOnPartAdapterShowDialog_1()
	{
		 //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 = string.Empty;
		System.Data.DataSet dsPartAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "PartAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			System.Data.DataRow adapterRow = dsPartAdapter.Tables[0].Rows[0];

			 //Map Search Fields to Application Fields
			{
			epiTextQS_PartNum.Text = adapterRow["PartNum"].ToString();
			}
	}
}

//Quote - New Quote - Launches Quote Configurator and Passes Information in the Create New Quote Section
	private void btnQS_NewQuote_Click(object sender, System.EventArgs args)
	{
	LaunchFormOptions lfo = new LaunchFormOptions();
	System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
	newcustid = epiTextQS_CustID.Text;
	mylist.Add("custid", newcustid); 
	newquoteqty = Convert.ToInt32(epiNumericQS_Qty.Text);
	mylist.Add("quantity", newquoteqty.ToString());
	newquotepartnum = epiTextQS_PartNum.Text;
	mylist.Add("partnum", newquotepartnum); 
	newnumcolors = Convert.ToInt32(epiNumericQS_NumColors.Text);
	mylist.Add("numofcolors", newnumcolors.ToString()); 
	newqtybreaks = Convert.ToInt32(epiNumericQtyBreaks.Text);
	mylist.Add("quantitybreaks", newqtybreaks.ToString());
	mylist.Add("actiontype", "NewQuote"); 
	mylist.Add("entitynum", "0");
	string valuein = "Quote";
	lfo.ValueIn = valuein;
	lfo.ContextValue = mylist;
	ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo); 
	}

//Quote Search in Quote Tracker Section
	private void btn_QS_Num1_Click(object sender, System.EventArgs args)
	{
		SearchOnQuoteAdapterShowDialog_1();
	}

//Quote Search in Quote Tracker Section
	private void SearchOnQuoteAdapterShowDialog_1()
	{
		 //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 = string.Empty;
		System.Data.DataSet dsQuoteAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "QuoteAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			System.Data.DataRow adapterRow = dsQuoteAdapter.Tables[0].Rows[0];
			// Map Search Fields to Application Fields
				QuoteRefNum.Value = adapterRow["QuoteNum"].ToString();
				numQuoteDtl_QuoteNum.Value = adapterRow["QuoteNum"].ToString();
				changequotenumber();
		}
}
		
//Quote - Edit Quote in Quote Tracker Section
	private void btn_QS_editquo1_Click(object sender, System.EventArgs args)
	{
	LaunchFormOptions lfo = new LaunchFormOptions();
	string valuein = "Quote";
	quotenum = Convert.ToInt32(QuoteRefNum.Text);
	string contextvaluein = quotenum.ToString();
	lfo.ValueIn = valuein;
	lfo.ContextValue = contextvaluein;
	ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo); 
	}

//Quote - On Quote Customer ID Leave of Field execute Dynamic Query to Populate Quote Memos by Customer
	private void epiTextQS_CustID_Leave(object sender, System.EventArgs args)
	{
		DynamicQueryAdapter dqa10 = new DynamicQueryAdapter(oTrans);
		dqa10.BOConnect();
		QueryExecutionDataSet qeds10 = dqa10.GetQueryExecutionParametersByID("GS_Quote_Memos");
		qeds10.ExecutionParameter.Clear();
		qeds10.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextQS_CustID.Text , "nvarchar", false, Guid.NewGuid(), "A");
		dqa10.ExecuteByID("GS_Quote_Memos", qeds10);
		epiUltraGridC4.DataSource = dqa10.QueryResults.Tables["Results"];
	}

//Quote - Refreshes Quote View
	private void changequotenumber()
       {
		QuoteRefNum.Value = numQuoteDtl_QuoteNum.Value;
        DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
        dqa.BOConnect();
        QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Quotes_Param");
        qeds.ExecutionParameter.Clear();
        qeds.ExecutionParameter.AddExecutionParameterRow("QuoteNum", QuoteRefNum.Value.ToString(), "nvarchar", false, Guid.NewGuid(), "B");
        dqa.ExecuteByID("GS_Quotes_Param", qeds);
        gridQuoteDtl.DataSource = dqa.QueryResults.Tables["Results"];
        edvV_GS_Quotes_1View.ResetDataView(dqa.QueryResults.Tables["Results"].DefaultView); 
        edvV_GS_Quotes_1View.Notify(new EpiNotifyArgs(oTrans, 0, EpiTransaction.NotifyType.Initialize));
		DynamicQueryAdapter dqa1 = new DynamicQueryAdapter(oTrans);
        dqa1.BOConnect();
        QueryExecutionDataSet qeds1 = dqa1.GetQueryExecutionParametersByID("GS_Quote_LetterUD15");
        qeds1.ExecutionParameter.Clear();
        qeds1.ExecutionParameter.AddExecutionParameterRow("QuoteNum", QuoteRefNum.Value.ToString(), "nvarchar", false, Guid.NewGuid(), "C");
        dqa1.ExecuteByID("GS_Quote_LetterUD15", qeds1);
        grid_QuoteLetterPrev.DataSource = dqa1.QueryResults.Tables["Results"];
		foreach (System.Data.DataRow r in dqa1.QueryResults.Tables["Results"].Rows)
		{
		epiTextBoxQuoteLetterHTML.Text = r["UD15_GS_BodyEmail_c"].ToString();
		epiTextBoxQuoteLetterTo.Text = r["UD15_GS_ToEmail_c"].ToString();
		epiDateTimeEditorQuoteLetterSentDate.Text = r["UD15_GS_SentTime_c"].ToString();
		}
		SetupBrowser_QuoteLetter();
		MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));	
  }

//Quote - Quote Letter Preview
 public void SetupBrowser_QuoteLetter()
	{
		wbSite = new System.Windows.Forms.WebBrowser();
		wbSite.Dock = System.Windows.Forms.DockStyle.Fill;
		wbSite.Location = new System.Drawing.Point(0,0);
		wbSite.MinimumSize = new System.Drawing.Size(20,20);
		wbSite.Name = "Quote Letter Preview";
		wbSite.Size = new System.Drawing.Size(560,323);
		wbSite.TabIndex = 0;
		epiGroupBoxQuoteLetterPrev.Controls.Add(wbSite);
		wbSite.DocumentText = epiTextBoxQuoteLetterHTML.Text.ToString();
}      

//Quote - Calls the View Update on Leave
	private void numQuoteDtl_QuoteNum_Leave(object sender, System.EventArgs args)
    {
		changequotenumber();
	 }

//Quote - Button to Clear New Quote Fields 
	private void btnQuoteClearForm_Click(object sender, System.EventArgs args)
	{
	epiTextQS_CustID.Text = string.Empty;
	epiTextQS_PartNum.Text = string.Empty;
	epiNumericQS_Qty.Value = "0";
	epiNumericQS_NumColors.Value = "0";
	epiNumericQtyBreaks.Value = "0";
	MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));	
	}

	private void edvV_GS_Order_Detail_All_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
		{
			if ((args.Row > -1))
			{

			}
		}
	}

	private void edvV_GS_CustomerSearch_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
		{
			if ((args.Row > -1))
			{
				//MessageBox.Show ("edvCustomer");
			}
		}
	}

	private void edvV_GS_Quotes_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
		{
			if ((args.Row > -1))
			{
				//MessageBox.Show ("edv quote view");
			}
		}
	}

	private void V_GS_Order_Detail_All_1View_AfterRowChange(EpiRowChangedArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.LastRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
	}

	private void V_GS_CustomerSearch_1View_AfterRowChange(EpiRowChangedArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.LastRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
			//MessageBox.Show ("Customer After Row Change");
	}

	private void V_GS_Quotes_1View_AfterRowChange(EpiRowChangedArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.LastRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
	}


}```

Try something like this; this assumes a couple things but should work


UltraGridRow activeRow = gridPOResults.ActiveRow;
epiTextBoxPORefNum.Text = activeRow.Cells["OrderHed_PONum"].Value.ToString( ) );

Still getting an error.
This is what I put:

private void gridPOResults_AfterRowActivate(object sender, System.EventArgs args)
	{
		UltraGridRow activeRow = gridPOResults.ActiveRow;
		epiTextBoxPORefNum.Text = activeRow.Cells["OrderHed_PONum"].Value.ToString();
	}```

Error: CS0246 - line 462 (4023) - The type or namespace name 'UltraGridRow' could not be found (are you missing a using directive or an assembly reference?)

Add a using statement in your code. This was one of the assumptions :slight_smile:

using Infragistics.Win.UltraWinGrid;
1 Like

Perfection!!! It worked! Thank you so much!!!