D
DC Gringo
Can someone show me how to turn this into a bi-directional sort allowing
ascending and descending using the default datagrid allowsorting attribute?
FYI, Session("source") is an sqldataadapter
------------
Protected Sub SortCommand_OnClick(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
DataGrid2.SortCommand
Dim ds As DataSet = GetDataSource()
Dim dt As DataTable = ds.Tables(0)
dt.DefaultView.Sort = e.SortExpression
DataGrid2.DataSource = dt.DefaultView
DataGrid2.DataBind()
End Sub
Protected Function GetDataSource() As DataSet
Dim ds As New DataSet
Dim da As New SqlDataAdapter
da = Session("Source")
da.Fill(ds)
Return ds
End Function
ascending and descending using the default datagrid allowsorting attribute?
FYI, Session("source") is an sqldataadapter
------------
Protected Sub SortCommand_OnClick(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
DataGrid2.SortCommand
Dim ds As DataSet = GetDataSource()
Dim dt As DataTable = ds.Tables(0)
dt.DefaultView.Sort = e.SortExpression
DataGrid2.DataSource = dt.DefaultView
DataGrid2.DataBind()
End Sub
Protected Function GetDataSource() As DataSet
Dim ds As New DataSet
Dim da As New SqlDataAdapter
da = Session("Source")
da.Fill(ds)
Return ds
End Function