GridView OnRowCreated won't compile

Discussion in 'ASP .Net Web Controls' started by tmartin@healthbanks.com, Sep 19, 2007.

  1. Guest

    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?
     
    , Sep 19, 2007
    #1
    1. Advertising

  2. Guest

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

    No overload for 'GridView1_RowCreated' matches DELEGATE
    'System.Web.UI.WebControls.GridViewRowEventHandler'
     
    , Sep 19, 2007
    #2
    1. Advertising

  3. 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

    > 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?
    >
     
    David R. Longnecker, Sep 20, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TdJ
    Replies:
    1
    Views:
    556
    Mike Moore [MSFT]
    Nov 12, 2003
  2. Chad
    Replies:
    4
    Views:
    8,339
  3. Alex Polite
    Replies:
    14
    Views:
    963
  4. Ward Loockx

    It won't compile !!

    Ward Loockx, Oct 10, 2004, in forum: Java
    Replies:
    4
    Views:
    3,836
    Lee Weiner
    Oct 10, 2004
  5. Nagaraj
    Replies:
    1
    Views:
    870
    Lionel B
    Mar 1, 2007
Loading...

Share This Page