Apply a Sort to a DataView bound to a grid , it is not working

Hello,

Something strange I am experiencing. I have a Custo, which reads a BAQ and the result of the BAQ is bound to the EpiUltraGrid dataview. I want to sort (asc) the view with a date field.

  1. Sorting works in the BAQ.
  2. If I read in debug mode the result table, it is correctly sorted
  3. If I read the dataView of the grid it is sorted.

But visually, the rows do not show sorted by default. I can always press the top of the column to have the rows sorted as wanted…but the sorting soed not seem to be applied originally.

I added code to force the sort as soon as the grid dataview is populated… as well here:

private void ExpedGrid_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
	{
		// ** Place Event Handling Code Here **
		
		this.edvGrille.dataView.Sort = "OrderRel_ReqDate ASC";
		ExpedGrid.Refresh();
		
	}

But the sort is not working…

What am I doing wrong? If the BAQ is already sorted, why the sort gets changed once copied to the grid? (It is sorted as first column sort, which is an ordernum)

what are my options?

Anyone?

thanks

Pierre

Anyone know how to refresh a grid view after the dataview has changed? I think it is same issue has my sorting not showing… I am changing the dataview but the grid is still bound to the original view… How do I refresh the relation of the Grid to it’s bound dataview? (I would tought it would be automatic! )

I tried the following:
this.GridEval.Rows.Refresh(Infragistics.Win.UltraWinGrid.RefreshRow.RefreshDisplay); with no results.

In debug mode, I can see the dataview with the new data, but the grid rows with nothing…

I am stuck her anyone can assist me?

Thanks you.

Pierre

@Hogardy, did you end up getting a resolution to this. I am in the same situation, RefreshDisplay or ReloadData does nothing. I am not sure how to “Refresh” Setting the EpiBinding to null and then adding it again does not appear to work either. Then again I could just be doing it wrong.

Well not the way I was originally thinking… but the following works well:

I have two dates entry box and a button to redo the seach via a BAQQuery, so that the result grid gets updated…

private void butSearch_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		if(dtStart.Value != null && dtEnd.Value != null )
		{//dvScans is the EpiDataView...
			dvScans.Row = -1;
			dvScans.dataView.Table.Clear();
			dvScans.dataView.Table.Merge(FillGrilleTRG( string.Format("{0:dd/MM/yyyy}",dtStart.Value), string.Format("{0:dd/MM/yyyy}",dtEnd.Value)));
		}	
		else
			MessageBox.Show("Missing dates parameters...");
		
	}
	
	private DataTable FillGrilleTRG(string Start, string End )
	{
		try
		{
			DataTable Table2 = null;
			//****Set a parameter Value*****
			Ice.Proxy.BO.DynamicQueryImpl oDynCustomerQuery = WCFServiceSupport.CreateImpl<Ice.Proxy.BO.DynamicQueryImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.DynamicQuerySvcContract>.UriPath);
			string BAQCustomerID = "Poly_ActivWareHouse";
			QueryExecutionDataSet dset2 = oDynCustomerQuery.GetQueryExecutionParametersByID(BAQCustomerID);
			
			foreach (DataRow r in dset2.ExecutionParameter)		
			{
	
	           switch (r["ParameterID"].ToString().ToUpper())		
	           {           
	                case "DATESTART":
	
	                   r["ParameterValue"] = Start;
						break;
					case "DATEEND":
	
	                   r["ParameterValue"] = End;
						break;
				
				}		
			}
			
			dset2.AcceptChanges();
			
			
			Table2 = oDynCustomerQuery.ExecuteByID(BAQCustomerID,dset2).Tables["Results"].Copy();
			
			return Table2;
		}
		catch(Exception ex)
		{
			MessageBox.Show(ex.ToString());
			return null;
		}
	}````

Now it works all the time !

Pierre.

Thanks Pierre. I’ll digest your code.

My problem is a bit simpler I hope.

I have a grid that accesses UD01 on the PO form. I have a UD02 form that when the update method of UD02 is fired a BPM updates records in the UD01 table. I’ve been trying to get the grid in the PO Form to update when you click the refresh button in the toolbar. Closing and Opening the PO from shows the reflected change. I would have thought it was simple, but no cigar yet.