We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Is there a Visual Basic example of the excellent Grid sorting demo I find in the samples?


5 Replies

KJ Konrad Jaschke July 1, 2016 01:18 AM UTC

I'm getting close to figuring it out, but I've got a question.

In my Compare Function I inspect the x object by doing a simple MsgBox(x.ToString())

CellValue = '14'

it would think I should be getting 14 (the actual value in the cell.

I've been following your VB code from this page and adapting it to my Listview Sort Comparer I wrote that works just fine.


When I look in the C++ Sorting example the comparer function has the following, which I'm lost at how to convert to VB.

//the idea is to get at the FormulaTag object in the GridStyleInfoStore passed in
//and use the FormulaTag.Text property to compare two cells.
GridStyleInfo xStyle = new GridStyleInfo((GridStyleInfoStore) x);
GridStyleInfo yStyle = new GridStyleInfo((GridStyleInfoStore) y);
string xs = (xStyle.FormulaTag != null) ? xStyle.FormulaTag.Text : "";
string ys = (yStyle.FormulaTag != null) ? yStyle.FormulaTag.Text : "";
double xd = 0;
double yd = 0;
double.TryParse(xs, System.Globalization.NumberStyles.Any, null, out xd);
double.TryParse(ys, System.Globalization.NumberStyles.Any, null, out yd);
c = xd.CompareTo(yd);

All I need is the actual cellvalue so I can check if its numeric, Date, or just string and do the appropriate type of search.

KJ Konrad Jaschke July 1, 2016 07:26 AM UTC

I got it all figured out.  Thanks!

AR Amal Raj U Syncfusion Team July 1, 2016 08:34 AM UTC

Hi Konrad, 

Thanks for using Syncfusion products. 

We are glad to hear that the issue has been resolved. Please let us know, If you need any further assistance. 

Amal Raj U. 

KJ Konrad Jaschke July 1, 2016 08:48 AM UTC

You don't have any of the sample projects is VB?

AR Amal Raj U Syncfusion Team July 1, 2016 10:17 AM UTC

Hi Konrad, 

Sorry for the inconvenience. 

The VB sample for the mentioned KB is attached below. 

Amal Raj U. 

Live Chat Icon For mobile
Up arrow icon