The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Excuse me the message was post before it was finish.
public class NumericSort : System.Collections.Generic.Comparer<object> {
public NumericSort():base() { System.Diagnostics.Trace.WriteLine("NumericComparer: creation"); }
public override int Compare(object x, object y) { System.Diagnostics.Trace.WriteLine("NumericComparer: Compare"); string sX = x.ToString(); string sY = y.ToString();
if ((sX != string.Empty) && (sY != string.Empty)) { // System.Diagnostics.Trace.WriteLine(string.Format("NumericComparer: Compare {0} , {1}", sY, sY)); int ix = int.Parse(sX); int iy = int.Parse(sY);
// return ix - iy; // * If they are both null, return 0 //* If x is null but not y, return -1 (x < y) // * If y is null but not x, return 1 (x > y). if (ix < iy) { return -1; } else if (ix < iy) { return 1; } else { return 0; }
} else { if (sX == string.Empty && sY == string.Empty) { return 0; } else if (sX == string.Empty) { // int iy = int.Parse(sY); // return - iy; return -1; } else { // int ix = int.Parse(sX); // return ix; return 1; } }
} }
Constructor was call, but compare function no.
Have you some example on CustomComparer ?
RARajasekar Syncfusion Team April 19, 2011 08:35 AM UTC
Hi Berthet,
Thanks for your update.
We have prepared the sample based on your requirement, please find the sample in the following location,