Jump to content

alterar imagebutton dentro de template field grid


Recommended Posts

Boa tarde....

Alguem me consegue explicar com faço isto

Protected Sub ImageButton11_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton11.Click
        ImageButton10.visible = True
        ImageButton11.Visible = False
    End Sub

dentro de uma gridview...

Criei os dois buttons no templatefield da gridview


Link to comment
Share on other sites

O que é que tens e o que é que queres fazer ao certo?

tens 2 botões num templatefield da GridView e qdo clicas num, queres que o outro seja escondido, é isso?

Na tua Gridview vais utilizar o evento OnRowCommand. Nesse teu evento, vais obter a row e, dentro da row, utilizas o findcontrol para obter os imagebutton.

Os teus imagebutton deverão ter a propriedade CommandArgument definida 😉

Pedro Martins

Sharing is Knowledge!


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.