Welcome Guest Search | Active Topics | Sign In | Register

Adding event handler for ButtonColumn in C# Options
Sean Vesce
Posted: Thursday, October 28, 2010 4:09:28 AM
Rank: Member
Groups: Member

Joined: 10/26/2010
Posts: 16
Searching for an example to demonstrate how in C# to hook up an event handler to a ButtonColumn within a Grid running in Server mode.

All relevant code examples on the forums show VB examples which implicitly add an event handler using the "Handles" keyword (but this method is not available in C#).

Any insight is appreciated!
eo_support
Posted: Thursday, October 28, 2010 9:40:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The key is you need to handle the Grid's ItemCommand event. If you use Visual Studio, you would just go to your Grid's property window, click the Event tab, then double click the event handler and it will generate the handler for you. There are multiple ways to attach the handler: either using a delegate or put OnItemCommand in your .aspx directly. Both Visual Studio and our sample (which was created with Visual Studio) use the OnItemCommand method. However it does not matter which method you use.

Hope this helps. Please feel free to let us know if you still have any questions.

Thanks!
Sean Vesce
Posted: Thursday, October 28, 2010 12:33:28 PM
Rank: Member
Groups: Member

Joined: 10/26/2010
Posts: 16
Thank you for the quick response! This is exactly what I was looking for. I'm new to both Visual Studio and C# so the most obvious solutions are sometimes elusive. Great library, BTW.
eo_support
Posted: Thursday, October 28, 2010 12:56:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Glad that we were able to help!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.