T
Todd
I have a datagrid (dgResults) that I am populating from a SQL stored
procedure. After I fill my dataset (ds), I cache the dataset this
way: Session("ds") = ds.Tables("Table1").Defaultview. After this I
set the Grid's datasource to the dataset and bind the Grid.
My sort is working fine for all but 2 columns. The 2 giving me
trouble are formatted as Currency. It's sorting these as if they are
strings ($1, $11, $2, $22, etc). How can I get these to sort in the
proper order (numeric)? I don't know if I need to change anything in
the sort command procedure, but here it is below:
Private Sub dgResults_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
dgResults.SortCommand
Dim dv2 As New DataView
dv2 = Session("ds")
dv2.Sort = e.SortExpression
dgResults.DataSource = dv2
dgResults.DataBind()
End Sub
procedure. After I fill my dataset (ds), I cache the dataset this
way: Session("ds") = ds.Tables("Table1").Defaultview. After this I
set the Grid's datasource to the dataset and bind the Grid.
My sort is working fine for all but 2 columns. The 2 giving me
trouble are formatted as Currency. It's sorting these as if they are
strings ($1, $11, $2, $22, etc). How can I get these to sort in the
proper order (numeric)? I don't know if I need to change anything in
the sort command procedure, but here it is below:
Private Sub dgResults_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
dgResults.SortCommand
Dim dv2 As New DataView
dv2 = Session("ds")
dv2.Sort = e.SortExpression
dgResults.DataSource = dv2
dgResults.DataBind()
End Sub