Alfaking
unread,Nov 5, 2009, 7:19:55 AM11/5/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
---------------------------
Private Sub CaricaUtenti()
Dim DS As DataSet
DS = Ser.getUtenti("U")
If Glb.checkDS(DS, Me.GetType.FullName, vErrDes, vErrSys) > 0 Then
dt = DS.Tables("Dati") '************************************THIS
IS NEW !!!!
Me.Elenco.DataSource = DS.Tables("Dati")
Me.Elenco.DataBind()
End If
DS = Nothing
end sub
-------------------------------
Private Sub Elenco_Sorting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewSortEventArgs) Handles
Elenco.Sorting
Dim expr As String
dv = New DataView(dt)
If Session("Order") = "ASC" Then
direc = "DESC"
Session("Order") = "DESC"
Else
direc = "ASC"
Session("Order") = "ASC"
End If
expr = e.SortExpression & " " & direc
dv.Sort = expr
Elenco.DataSource = dv
Elenco.DataBind()
End Sub
------------------------------------------------
now it works !!!!
BUT, in the page load I have this
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
'If Not Me.IsPostBack Then ******** COMMENT
CaricaUtenti()
'End If ********COMMENT
Exit Sub
End Sub
-----------------------------------------------------------
The thing is that everytime I have to pass through CaricaUtenti()
(that is the "main" sub) otherwise the sort functionality doesn't
work.
I Think it's not a good solution, because if I have a very big table,
I have to load it again every time I try to sort it...
Any suggestion ?