Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Events in Template Column
Message
De
20/11/2003 02:54:34
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00851702
Message ID:
00851738
Vues:
8
>I am sure this is simple, but it is sure stumping me!
>How do I capture a button click event on a template column of an ASP.NET grid? The button in the template column does not have an events tab.
>
>Here are the steps I performed: I added a template column to the grid - dropped a button in the item section of the template editor - set the CommandName of the button to 'Configure' - ensured CausesValidation=True - created an ItemCommand event on the grid.
>
>The button seems to refresh the page, but where can I capture this event so I can do work?
>
>Thanks!
>Troy

Troy,

You have to handle the click in the ItemCommand event. Test e.CommandSource.CommandName to determine which button was clicked (you might have to cast e.CommandSource as a CommandButton to avoid a compiler error).

There is a nice series of articles on the DataGrid at http://aspnet.4guysfromrolla.com/articles/040502-1.aspx
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform