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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

6176 Aug 3,2003 03:28 PM UTC Aug 4,2003 05:28 AM UTC WinForms 4
loading
Tags: GridControl
Randy Kennison
Asked On August 3, 2003 03:28 PM UTC

Trying to get a sort to work the way I need and am running into a problem. The column is of type Int64, contain's numeric data with a format specifier of N0. Why when sorted, is it sorting this data as text? Resulting in the sort doing something along the lines of... 1 1111 77 9 If my data were text, this would be fine, but it's not. What to do? Any suggestions?

Administrator [Syncfusion]
Replied On August 3, 2003 04:54 PM UTC

Is this a GridDataBoundGrid? If so, try setting the CellValueType to typeof(Int64). You can do this either through the grid.GridBoundColumns if you have explicitly added them, or through the grid.Binder.InternalColumns if you haven't explicitly added gridboundcolumns.
this.grid.InternalColumns.StyleInfo.CellValueType = typeof(Int64);
If this is a GridControl, then make sure the grid.ColStyles[col].CellValueType is set to typeof(Int64).

Randy Kennison
Replied On August 4, 2003 02:04 AM UTC

It's a gridControl. And I did set the value to Int64 through the designer. I also added it to the code, and even went so far as to set each cell ( just for giggles ) to a CellValueType of typeof( Int64 ). Does the same thing.I was convinced that it's looking at the "text" that is displayed in the grid instead, and seeing the ',' characters that the N0 format will create. So I removed that type from a column or 2, and I get the same behavior... So that's not it. This is driving me nutz at this point as I"m sure it's something so simple I'm overlooking.

Randy Kennison
Replied On August 4, 2003 03:59 AM UTC

And... it was. I was using the PopulateValues call, and passing in a 3d array of strings. Apparently, that set's teh cell's ValueType to a string. Just currious, I tried to set the cells back to the correct type manually, called refresh, no change. I just had to create a custom class to hold the IList derived object, and stoped using the string [,] array to populate the list in mass.

Administrator [Syncfusion]
Replied On August 4, 2003 05:28 AM UTC

Is this the code you tried after calling PopulateValues? this.grid.ColStyles[col].CellValueType = typeof(Int64); If this did not work, PopulateValues must have set the individual cells styles to string. So, if that is the case, try: GridStyleInfo style = new GridStyleInfo(); style.CellValueType = typeof(Int64); this.grid.ChangeCells(GridRangeInfo.Cells(1, col, this.grid.RowCount, col), style, Syncfusion.Styles.StyleModifyType.Override); to change the individual cell styles back.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;