Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sorting:
VB
DgvResults.DataSource = Dv
If DgvResults.RowCount > 0 Then
    DgvResults.CurrentCell = DgvResults.Item(cmbInd, 0)
End If
Try
    If IsNumeric(DgvResults.Rows(0).Cells(CmbSearchBy.SelectedIndex).Value) Then
         DgvResults.Columns(CmbSearchBy.SelectedIndex).ValueType = GetType(Integer)
    End If

  DgvResults.Sort(DgvResults.Columns(CmbSearchBy.SelectedIndex), System.ComponentModel.ListSortDirection.Descending)
Catch ex As Exception



'CmbSearchBy This combo box contains every column value to sort accordingly

when there is a column with numeric type it is not sorting correctly,so
I have converted numeric column "valuetype" to "number" before sorting but no use...

pls can anybody answer my question...
Posted
Updated 5-Dec-13 20:23pm
v4
Comments
OriginalGriff 5-Dec-13 5:36am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
Ganesh Raja 5-Dec-13 5:38am    
Before sorting only u r doing the conversion or before loading the data to gridview u r doing the conversion?
Saikumar Guptha 5-Dec-13 5:44am    
BEFORE SORTING
Nelek 6-Dec-13 3:02am    
Neither is your question.

And please, stop using "sms-chat". If you want to be taken seriously, start "speaking" correctly.

1 solution

Bind the column in integer and try this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900