Home All Groups Group Topic Archive Search About

GridView OnRowCreated won't compile

Author
19 Sep 2007 6:50 PM
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?

Author
19 Sep 2007 6:55 PM
tmartin
One minor correction to the error text above.  The error is:

No overload for 'GridView1_RowCreated' matches DELEGATE
'System.Web.UI.WebControls.GridViewRowEventHandler'
Author
20 Sep 2007 12:26 AM
David R. Longnecker
RowCreated doesn't have a signature (hence the overload error) with GridViewCommandEventArgs
in it, it's GridViewRowEventArgs.

HTH.

-dl

--
David R. Longnecker
http://blog.tiredstudent.com

Show quote
> 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?
>

AddThis Social Bookmark Button