Manually Populating the UD102 Screen via Code

I executed this code to manually populate the screen via code, and it works except for the data navigation object. Has anyone experienced this issue? Was it resolved?

UD102Adapter adapter = (UD102Adapter)oTrans_adapter;
		    //add more keys to clause if need be. 	
            string whereClause = String.Format("Key1 = '{0}'", key1);
   			System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
			whereClauses.Add("UD102", whereClause);

			// Call the adapter search.
			SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
			adapter.InvokeSearch(searchOptions);

			if ((adapter.UD102Data.UD102.Rows.Count > 0))
			{
				this.edvUD102.Row = 0;
			} else
			{
				this.edvUD102.Row = -1;
			}

			// Notify that data was updated.
			this.edvUD102.Notify(new EpiNotifyArgs(this.oTrans, this.edvUD102.Row, this.edvUD102.Column));

1 Like

@adaniell

I hadn’t noticed that the navigation control uses a different EpiBinding than the rest of the screen, I just assigned the result and that was it.

EpiDataView edvListView = ((EpiDataView)(this.oTrans.EpiDataViews["ListView"]));

		UD102Adapter adapter = (UD102Adapter)oTrans_adapter;
		    //add more keys to clause if need be. 	
            string whereClause = String.Format("Key1 = '{0}'", "Test");
   			System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
			whereClauses.Add("UD102", whereClause);

			// Call the adapter search.
			SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
			adapter.InvokeSearch(searchOptions);

			if ((adapter.UD102Data.UD102.Rows.Count > 0))
			{
				this.edvUD102.Row = 0;	
				edvListView.Row = 0;			
			} else
			{
				this.edvUD102.Row = -1;	
				edvListView.Row = -1;
			}

			// Notify that data was updated.
			this.edvUD102.Notify(new EpiNotifyArgs(this.oTrans, this.edvUD102.Row, this.edvUD102.Column));
			edvListView.Notify(new EpiNotifyArgs(this.oTrans, edvListView.Row, edvListView.Column));
			this.oTrans.NotifyAll();
1 Like