I'm developing a SharePoint application using code-behind pages. I've got a WebGrid displaying data from a SharePoint list. I want to write an event-handler for the OnActiveRowChange event (cannot use auto wire-up in SharePoint code-behind). I've added event handlers for some buttons, but I get a compile time error when I try to add the handler for the OnActiveRowChange event:
"Cannot assign to 'OnActiveRowChange' because it is a 'method group'"
I'm running NetAdvantage 2008 V3, CLR 2.0
Any ideas on how to resolve this?
I'm using C#, and here's the code line I'm using:
uwgClientGrid.OnActiveRowChange += uwgClientGrid_ActiveRowChange;
I have a regular ASP.NET application that works, and I copied that line from it. In both applications the line is in the Page_Load event handler.
I've tried placing it in the OnInit event handler, with the same result.
What syntax are you using to establish the event handler that is resulting in this error message?
Also, are you using C# or VB.NET? This will determine whether I suggest using the "+=" operator in C# or the "AddHandler" statement in VB.NET.