Toon posts:

[ASP.Net] Linkbutton in templatecolumn

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hallo,

ik heb hier een datagrid, waarvan ik de kolom waar de noramele delete link/knop stond heb veranderd een een templatecolumn.
Maar nu triggerd die niet meer de DeleteCommand.

Hoe kan ik dit oplossen en kan ik zelf events koppelen aan die linkbutton.

  • alley
  • Registratie: Mei 2002
  • Laatst online: 18-08 20:40

alley

ahuh

zet in je templatecolumn een linkbutton neer, en geef die de property: commandName="delete"

I am always doing that which I can not do, in order that I may learn how to do it. (Pablo Picasso)


Verwijderd

Topicstarter
Dit is de linkbutton de in de templatecolumn staat
code:
1
<asp:LinkButton runat="server" Text="Delete" CommandName="Delete" CausesValidation="false"></asp:LinkButton>

maar deze procedure staart ie niet
code:
1
2
Private Sub dgCategories_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgCategories.DeleteCommand
end Sub

  • alley
  • Registratie: Mei 2002
  • Laatst online: 18-08 20:40

alley

ahuh

Je moet je event nog aan je grid koppelen:
<code>
<asp:grid runat="server" onDeleteCommand="dgCategories">
</code>

(Mocht je functie in de code-behind file ipv de .aspx staan, moet ie wel 'protected' worden ipv 'private')

I am always doing that which I can not do, in order that I may learn how to do it. (Pablo Picasso)


Verwijderd

Topicstarter
Werkt niet, dan krijg ik dit:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30408: Method 'Protected Overridable Property dgCategories() As System.Web.UI.WebControls.DataGrid' does not have the same signature as delegate 'Delegate Sub DataGridCommandEventHandler(source As Object, e As System.Web.UI.WebControls.DataGridCommandEventArgs)'.

  • alley
  • Registratie: Mei 2002
  • Laatst online: 18-08 20:40

alley

ahuh

ok, typefoutje... maar als je dat niet ziet moet je misschien toch nog ff wat tutorials doornemen :D

code:
1
<asp:grid runat="server" onDeleteCommand="dgCategories_DeleteCommand">

I am always doing that which I can not do, in order that I may learn how to do it. (Pablo Picasso)


Verwijderd

Topicstarter
Nou dat doet ie dus ook niet,
dat had ik al geprobeerd.

Als ik de handles ... achter de functie erbij zet of weg laat maakt ook niets uit.

Hij komt totaal niet in de functie

  • alley
  • Registratie: Mei 2002
  • Laatst online: 18-08 20:40

alley

ahuh

Geeft ie dan nog steeds foutmelding?

I am always doing that which I can not do, in order that I may learn how to do it. (Pablo Picasso)

Pagina: 1