J
Jennifer
I've got a datagrid. The sort is working. But the columns that are
numeric are being sorted alphabetically. For example: 1,2,10,20 would
come out 1,10,2,20. Not sure how to get around this. I'm new to
datagrids in Visual Studio 2005. My sort code is below. Any
suggestions would be appreciated.
Thanks,
Jennifer
Private Sub dgDSR_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
dgDSR.SortCommand
Dim SortExpression As String
Dim SortType As String
If txtUnitID.Text = "" Or txtStartDate.Text = "" Then Exit Sub
SortType = ""
SortExpression = e.SortExpression.ToString
If SortExpression <> "" Then
If rbSort.Items(0).Selected = True Then
SortType = SortExpression & " ASC"
Else
SortType = SortExpression & " DESC"
End If
End If
FillGrid(SortType)
End Sub
numeric are being sorted alphabetically. For example: 1,2,10,20 would
come out 1,10,2,20. Not sure how to get around this. I'm new to
datagrids in Visual Studio 2005. My sort code is below. Any
suggestions would be appreciated.
Thanks,
Jennifer
Private Sub dgDSR_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
dgDSR.SortCommand
Dim SortExpression As String
Dim SortType As String
If txtUnitID.Text = "" Or txtStartDate.Text = "" Then Exit Sub
SortType = ""
SortExpression = e.SortExpression.ToString
If SortExpression <> "" Then
If rbSort.Items(0).Selected = True Then
SortType = SortExpression & " ASC"
Else
SortType = SortExpression & " DESC"
End If
End If
FillGrid(SortType)
End Sub