Hello.
I am trying to sort a DataView and the Sort property does not work. It just doesn't sort anything!
Here's the code- it is placed in the SortCommand event of the DataGrid (pss.. I am using framework v1.1 and VS2003 - Datagrid was build using designer)
Private Sub grilleAffichage_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles grilleAffichage.SortCommand
And this code has proven me that the View is unsorted:
Oh and yes, the DataGrid has AllowSorting to True.
Any ideas?
Thanks
I am trying to sort a DataView and the Sort property does not work. It just doesn't sort anything!
Here's the code- it is placed in the SortCommand event of the DataGrid (pss.. I am using framework v1.1 and VS2003 - Datagrid was build using designer)
Private Sub grilleAffichage_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles grilleAffichage.SortCommand
VB.NET:
Me.dsAffichage.Tables("Formulaire").DefaultView.Sort = "NomEmplInterv Asc" ' The column exists and the DataSet has values.
grilleAffichage.DataSource = Me.dsAffichage.Tables("Formulaire").DefaultView
grilleAffichage.DataBind()
VB.NET:
For each dr in Me.dsAffichage.Tables("Formulaire").DefaultView.Table.Rows
concat = concat & CType(dr("NomEmplInterv"), String) & vbNewLine
Next
Oh and yes, the DataGrid has AllowSorting to True.
Any ideas?
Thanks