Jump to content

Gridview: Sort Manual


DarkAngelRev

Recommended Posts

Boas.

num webform tenho dois gridviews, num o datasource foi definido nas propriedades do mesmo e posso activar o sort sem problema e está tudo ok... acontece que no segundo o datasource foi definido por código uma vez que este tem de poder ser alterado, mas ao activar o sort dá-me erro. pelo que decidi criar eu manualmente o evento mas algo não está bem. se alguém puder dar uma vista de olhos agradecia.

rotected Sub gvPrimavera_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles gvPrimavera.Sorting
 If sender = "Cliente" Then
	 gvPrimavera.Sort("Cliente", SortDirection.Ascending)
 ElseIf sender = "Nome" Then
	 gvPrimavera.Sort("Nome", SortDirection.Ascending)
 ElseIf sender = "NumContrib" Then
	 gvPrimavera.Sort("NumContrib", SortDirection.Ascending)
 ElseIf sender = "Pais" Then
	 gvPrimavera.Sort("Pais", SortDirection.Ascending)
 End If
End Sub

Thanks!!

Edited by Caça
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.