Hi Telerik Team,
I encounter that when i am using the RadGridView to do sorting, for example: i am about to sort 1,2,3,4,5,6,7,8,9,10 in descending manner where the datatype is smallint, the grid will return 9,8,7,6,5,4,3,2,1,10 in which i expected 10,9,8,7,6.....,1 since it is smallint datatype.
Pls Help. Thanks
I encounter that when i am using the RadGridView to do sorting, for example: i am about to sort 1,2,3,4,5,6,7,8,9,10 in descending manner where the datatype is smallint, the grid will return 9,8,7,6,5,4,3,2,1,10 in which i expected 10,9,8,7,6.....,1 since it is smallint datatype.
Pls Help. Thanks
5 Answers, 1 is accepted
0
Hello eriksurya,
Your problem seems to be related to the fact that the grid sorts the column as if they are of type string. Check your data source to confirm this. If you manually add the column (through the RadGridView.MasterGridViewTemplate.Columns collection), be sure to create the correct column type.
Regards,
Evtim
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Your problem seems to be related to the fact that the grid sorts the column as if they are of type string. Check your data source to confirm this. If you manually add the column (through the RadGridView.MasterGridViewTemplate.Columns collection), be sure to create the correct column type.
Regards,
Evtim
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Erik
Top achievements
Rank 1
answered on 30 Aug 2007, 01:06 AM
Thanks for the quick reply.
I confirm that the data type is smallint.
I bounded the table from database to the grid, and sort the column (smallint datatype) using the following code:
mysort = new RadSortExpression
mysort.FieldName = "NOS"
mysort.sortorder = RadSortOrder.Descending
RadGridView1.MasterGridViewTemplate.SortExpressions.Set(mysort)
thanks......
I confirm that the data type is smallint.
I bounded the table from database to the grid, and sort the column (smallint datatype) using the following code:
mysort = new RadSortExpression
mysort.FieldName = "NOS"
mysort.sortorder = RadSortOrder.Descending
RadGridView1.MasterGridViewTemplate.SortExpressions.Set(mysort)
thanks......
0
To confirm what causes the problem, please, check the type of column that is created when binding the grid, then check its DataType.
Here is a sample code:
The output should be something like: Column: GridViewTextBoxColumn, Column type: System.Int16
Please, let us know what the output is, so that we could further investigate the problem.
Regards,
Evtim
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Here is a sample code:
radGridView1.DataSource = bindingSource; |
GridViewDataColumn gvdc = radGridView1.MasterGridViewTemplate.Columns["NOS"] as GridViewDataColumn; |
Debug.WriteLine(string.Format("Column: {0}, Column type: {1}", gvdc.GetType().ToString(), gvdc.DataType.ToString())); |
The output should be something like: Column: GridViewTextBoxColumn, Column type: System.Int16
Please, let us know what the output is, so that we could further investigate the problem.
Regards,
Evtim
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Erik
Top achievements
Rank 1
answered on 04 Sep 2007, 07:51 AM
Thanks for the reply
Yes.. the datatype of the column in grid is "System.String"
So, Any suggestion on this issue?
Shouldn't the datatype of the column of the grid follows the datasource?
Yes.. the datatype of the column in grid is "System.String"
So, Any suggestion on this issue?
Shouldn't the datatype of the column of the grid follows the datasource?
0
Hello eriksurya,
We did locate the problem in the Q1 SP2 release. The fix is available in the Q2 Beta. Please, download the beta and give it a spin.
Best,
Evtim
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
We did locate the problem in the Q1 SP2 release. The fix is available in the Q2 Beta. Please, download the beta and give it a spin.
Best,
Evtim
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center