neegottlob
Programmer
Hello,
this is my code:
The Problem is that when I click the Header text It always Sort it by Ascending and never reverse it. So I've tried to debug and when I changed manuale the value of SortDirection to descenting it still kept sorting it only ascendint. So is there any posobility to change the direction of the sorting.
Thank You,
G. Kalchev
this is my code:
Code:
<script runat="server">
Dim authors As New DataSet()
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
............
End Sub
Protected Sub GridView1_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs)
' Retrieve the data source from session state.
Dim dt As DataTable = CType(Session("Sorting"), DataTable)
' Create a DataView from the DataTable.
Dim dv As DataView = New DataView(dt)
If e.SortDirection = SortDirection.Ascending Then
e.SortDirection = SortDirection.Descending
Else
e.SortDirection = SortDirection.Ascending
End If
dv.Sort = e.SortExpression
GridView1.DataSource = dv
GridView1.DataBind()
End Sub
The Problem is that when I click the Header text It always Sort it by Ascending and never reverse it. So I've tried to debug and when I changed manuale the value of SortDirection to descenting it still kept sorting it only ascendint. So is there any posobility to change the direction of the sorting.
Thank You,
G. Kalchev