K
kurt sune
I have a an aspx page with a gridview.
The gridview is data bound to a generic list of custom classes.
The gridview's DataSource is thus not set.
Now I want to add sorting to it.
So I create an eventhandler thus:
Protected Sub grdResult_Sorting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdResult.Sorting
Static Sorting As Boolean = False
If Not Sorting Then
Sorting = True
GridViewSortExpression = e.SortExpression
grdResult.Sort(GridViewSortExpression, GetSortDirection)
grdResult.DataBind()
End If
End Sub
The effect is that the gridview doesn't get rendered.
If I comment out the databind it gets rendered but not sorted.
In debug mode I can se that the grid is populated allright.
What am I doing wrong?
/k
The gridview is data bound to a generic list of custom classes.
The gridview's DataSource is thus not set.
Now I want to add sorting to it.
So I create an eventhandler thus:
Protected Sub grdResult_Sorting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdResult.Sorting
Static Sorting As Boolean = False
If Not Sorting Then
Sorting = True
GridViewSortExpression = e.SortExpression
grdResult.Sort(GridViewSortExpression, GetSortDirection)
grdResult.DataBind()
End If
End Sub
The effect is that the gridview doesn't get rendered.
If I comment out the databind it gets rendered but not sorted.
In debug mode I can se that the grid is populated allright.
What am I doing wrong?
/k