P
Paul
Hi, I have a generic list and am able to sort it using the code below that I
have built in a class UserDefinedGroupSummary. There is an integer in the
class called GroupNumber and the sort by group number does return a list with
the group numbers sorted. The problem is when there is only one group number
in the list, it looks like it is still changing the order of the elements in
the list.
Any ideas, thanks.
I use grouplist.Sort();// to sort the group generic list
In the class I have
public static Comparison<UserDefinedGroupSummary> CompareGroup =
delegate(UserDefinedGroupSummary g1, UserDefinedGroupSummary g2)
{
return g1.GroupNumber.CompareTo(g2.GroupNumber);
};
#region IComparable<UserDefinedGroupSummary> Members
public int CompareTo(UserDefinedGroupSummary other)
{
return GroupNumber.CompareTo(other.GroupNumber);
}
#endregion
have built in a class UserDefinedGroupSummary. There is an integer in the
class called GroupNumber and the sort by group number does return a list with
the group numbers sorted. The problem is when there is only one group number
in the list, it looks like it is still changing the order of the elements in
the list.
Any ideas, thanks.
I use grouplist.Sort();// to sort the group generic list
In the class I have
public static Comparison<UserDefinedGroupSummary> CompareGroup =
delegate(UserDefinedGroupSummary g1, UserDefinedGroupSummary g2)
{
return g1.GroupNumber.CompareTo(g2.GroupNumber);
};
#region IComparable<UserDefinedGroupSummary> Members
public int CompareTo(UserDefinedGroupSummary other)
{
return GroupNumber.CompareTo(other.GroupNumber);
}
#endregion