M
mark
i have populated a datagrid succesfully and enabled sort successfully except
its not bidirectional - how do i do this ?
this is my code for sorting
Private Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
DataGrid1.SortCommand
Dim strConn As String = connectionstring
Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "SELECT * FROM extensionlist ORDER BY " &
e.SortExpression
Dim da As New System.Data.sqlclient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
conn.Close()
Label5.Text = e.SortExpression
End Sub
i know its something to do with adding DESC and ASC to the sql string but im
not sure how
thanks
mark
its not bidirectional - how do i do this ?
this is my code for sorting
Private Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
DataGrid1.SortCommand
Dim strConn As String = connectionstring
Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "SELECT * FROM extensionlist ORDER BY " &
e.SortExpression
Dim da As New System.Data.sqlclient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
conn.Close()
Label5.Text = e.SortExpression
End Sub
i know its something to do with adding DESC and ASC to the sql string but im
not sure how
thanks
mark