GridView OnRowCreated won't compile

T

tmartin

Hi all,
I'm having a strange issue with getting my GridView - OnRowCreated
method to compile. I've got a simple GridView with the following:

<asp:GridView ID="GridView1" runat="server"
OnRowCreated="GridView1_RowCreated"
OnRowCommand="GridView1_RowCommand">

And in my code behind I have the following:

protected void GridView1_RowCreated(object sender,
GridViewCommandEventArgs e)
{
string s = "hello";
}

The error I receive during compile is:

No overload for 'GridView1_RowCreated' matches deleted
'System.Web.UI.WebControls.GridViewRowEventHandler'

I have a similar setup for the OnRowCommand method with no compile
issues.

Any ideas?
 
T

tmartin

One minor correction to the error text above. The error is:

No overload for 'GridView1_RowCreated' matches DELEGATE
'System.Web.UI.WebControls.GridViewRowEventHandler'
 
D

David R. Longnecker

RowCreated doesn't have a signature (hence the overload error) with GridViewCommandEventArgs
in it, it's GridViewRowEventArgs.

HTH.

-dl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top