Hi,
I have 3 columns by the name of level1name, level3name, level3name to groupby. But I want to sort these columns by level1position,level2position,level3position.
I am creating one class GroupByComparer : IComparer which implements Icompare interface.
I am calling this class in for loop for each columns. But this gets execute only for last column, not for all the column. This is sorting level3position for sorting not for all. please tell me whats the issue. I want to sort all the columns.
{
string groupPos = "level" + i + "Position";
gdOverView.DisplayLayout.Bands[0].Columns[groupColName].GroupByComparer = new GroupByComparer();
}
internal class GroupByComparer : IComparer{
public int Compare(object x, object y)
try
UltraGridGroupByRow rowY = (UltraGridGroupByRow)y;
return 0;
return -1;
object xValue = GetSortByValue(rowX);
// return ((IComparable)((UltraGridGroupByRow)rowX).Value).CompareTo(((UltraGridGroupByRow)rowY).Value);
// Logger.Write(ex);
Hello Rosymalhotra,
I`m not familiar with your scenario, but maybe will be better to call ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Add("Column Key",true,false) for your columns. Also when you have "Multi sort" the order of sorted columns is important.0ne possible reason to have such kind behavior, could be if you didn`t set the property For example: - ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.ExternalSortMulti;Please let me know if you have any further questions.Regards