Please don't cross-post. Here is your answer:
Private Sub dg_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
dg.PageIndexChanged
dg.CurrentPageIndex = e.NewPageIndex
'Sort the new page according to the last sort criteria
Dim dv As New DataView(dsCusts.Tables(0))
dv.Sort = ViewState.Item("lastSort")
dg.DataSource = dv
dg.DataBind()
End Sub
Private Sub dg_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
dg.SortCommand
Dim dv As New DataView(dsCusts.Tables(0))
dv.Sort = e.SortExpression
dg.DataSource = dv
dg.DataBind()
'Store the desired sort criteria so that it can be applied when
paging occurs
ViewState.Add("lastSort", e.SortExpression)
End Sub
"taly" <ta****@rad.co.il> wrote in message
news:cf**********@news2.netvision.net.il...
Hi all
how can I make the interface for the user so he can sort datagrid?
thanks