11/26/2024 7:26:01 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
How to sort a column of datagrid by integer rather than character
Posted: 17 Nov 09 3:49 PM
|
I had a grid "myGrid" and populated it programmatically through
Set colSchoolID = myGrid.Columns.Add(0) colSchoolID.FieldName = "SchoolID" colSchoolID.Caption = "SchoolID"
Set colLogins = myGrid.Columns.Add(0) colLogins.FieldName = "Logins" colLogins.Caption = "Logins" colLogins.FormatType = 2 'Set the FormatType of the column as integer
I created a recortset "myRS" by "SELECT SchoolID, SUM(Login) AS Logins FROM myTable GROUP BY SchoolID"
and then:
Set myGrid.Recordset = myRS myGrid.Refresh
The grid dispalyed well. But cilcking the header of the coulmn "Logins", I got
SchoolID Logins 1 0 2 123 3 5
It looked like the grid was sorted by character instead of integer. The correct result that I need is: SchoolID Logins 1 0 3 5 2 123
What did I miss?
Thanks in advance.
|
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|