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!
|
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!
|
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.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You are very welcome. Glad that we were able to help!
|