Sorting by two columns on a tracker

Is it possible to sort by two columns on a tracker? For example, the Select Invoice, I want to sort by Vendor and then by Inv Date.

Yes. You have to add code to a customization to enable it however. Grab the grid and enable multi sort. Then the easiest thing to do from there is program it to sort the way you want. After multi sort is enabled holding shift and clicking the columns can also setup the mutlisort. The documentation for enabling that can be searched out on Infragistics site.

i believe if you reverse the logical order of column clicks you will get a similar result
So to sort BY VENDOR then BY DATE
first click on the DATE column
then click on the VENDOR column

I found this, not a programmer, so copy and paste didnt work.

using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

line 23 private void button50_Click(object sender, System.EventArgs e)
{

	// HeaderClickAction indicates the action that the UltraGrid should take when a column
	// header is clicked. Select causes the UltraGrid to select the column and SortMulti or
	// SortSingle causes it to sort the column. Default is SortMulti in OutLookGroupBy 
	// view style and Select otherwise.

	// Set the HeaderClickAction on the layout's override. 
	this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	// You can override that grid-wide setting for a particular band by setting it on the
	// override of that band.

Line36 this.ultraGrid1.DisplayLayout.Bands[1].Override.HeaderClickAction = HeaderClickAction.Select;

I get error
Error: CS1518 - line 23 (23) - Expected class, delegate, enum, interface, or struct
Error: CS1001 - line 36 (36) - Identifier expected

** Compile Failed. **

this.ultraGrid1 is generic you actually have to have your grid object in that spot. You will need to use the csm.GetNativeReference if you are editing a grid that is there from Epicor and set that to a local variable in your script.

This piece is really all you need in form load along with the usings.
this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

the rest of the code is noise.

1 Like