D
DC Gringo
I have a datagrid that won't sort. The event handler is firing and return
label text, just not the sort.
Here's my Sub Page_Load and Sub DataGrid1_SortCommand:
--------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
SqlDataAdapter1.Fill(DsAdvanced1)
If Not IsPostBack Then
DataGrid1.DataBind()
Provinces.DataBind()
Districts.DataBind()
SubDistricts.DataBind()
Communities.DataBind()
End If
End Sub
--------------------
Public Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
DataGrid1.SortCommand
lblWhatClicked.Text = "You clicked: " & e.SortExpression
Dim dv As New DataView(DsAdvanced1.Tables(0))
dv.Sort = e.SortExpression
DataGrid1.DataSource = dv
DataGrid1.DataBind()
End Sub
label text, just not the sort.
Here's my Sub Page_Load and Sub DataGrid1_SortCommand:
--------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
SqlDataAdapter1.Fill(DsAdvanced1)
If Not IsPostBack Then
DataGrid1.DataBind()
Provinces.DataBind()
Districts.DataBind()
SubDistricts.DataBind()
Communities.DataBind()
End If
End Sub
--------------------
Public Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
DataGrid1.SortCommand
lblWhatClicked.Text = "You clicked: " & e.SortExpression
Dim dv As New DataView(DsAdvanced1.Tables(0))
dv.Sort = e.SortExpression
DataGrid1.DataSource = dv
DataGrid1.DataBind()
End Sub