G
Guest
Hi. I have a webform datagrid which should sort whenever the column is
clicked. However, when the column is clicked no sorting occurs and the
datagrid (with the exception of the header) disappears. My code to perform
the datagrid sort is below. My datagrid's AllowSorting property is TRUE.
Could someone please let me know how I can fix this code so that the datagrid
sorts correctly? Thanks.
Private Sub DataGrid1_SortCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) _
Handles DataGrid1.SortCommand
DataGrid1.DataSource = DsLogs.spLogsSelect.DefaultView.Sort
DsLogs.spLogsSelect.DefaultView.Sort = e.SortExpression
DataGrid1.DataBind()
End Sub
I've also read the following article to noavail
http://msdn.microsoft.com/library/d...code/html/vbtskcodesortingdatagridcontrol.asp
clicked. However, when the column is clicked no sorting occurs and the
datagrid (with the exception of the header) disappears. My code to perform
the datagrid sort is below. My datagrid's AllowSorting property is TRUE.
Could someone please let me know how I can fix this code so that the datagrid
sorts correctly? Thanks.
Private Sub DataGrid1_SortCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) _
Handles DataGrid1.SortCommand
DataGrid1.DataSource = DsLogs.spLogsSelect.DefaultView.Sort
DsLogs.spLogsSelect.DefaultView.Sort = e.SortExpression
DataGrid1.DataBind()
End Sub
I've also read the following article to noavail
http://msdn.microsoft.com/library/d...code/html/vbtskcodesortingdatagridcontrol.asp