Hello, first post here.
Edit: "
The following code I'd like to use to sort one of my columns:
Char[] myArr = new Char[1] { 'A', '!', 'B', 'C', '$' };
IEnumerable<char> yourOriginalValues;
yourOriginalValues = myArr;
IEnumerable<char> result =
yourOriginalValues.Where(c => Char.IsLetterOrDigit(c))
.OrderBy(c => c)
.Concat(yourOriginalValues.Where(c => !Char.IsLetterOrDigit(c)));
"
So far I have
private void ultraGridDaySheet_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
e.Layout.Override.HeaderClickAction = HeaderClickAction.ExternalSortMulti;
}
Hi,
If you want to sort a column in a custom order, then the thing to do it implement the IComparer interface and then set the SortComparer property on the column to an instance of the implementor.
If you do a search on these forums for "IComparer" or "SortComparer", I'm sure you'll find a whole bunch of sample code.
Quick question, when I'm returning the value of:
int IComparer.Compare(object x, object y)
Is it returning the position for the string?
No. You need to return any number bigger than zero if x > y, or any number below zero if y > x, or zero if they are equal.