No overload for 'dg_Slate_OnItemDataBound' matches delegate 'System.Web.UI.WebControls.DataGridItemEventHandler'

Posted on 2007-08-09
Last Modified: 2008-01-09
I have a datagrid
<asp:datagrid ID="dg_Slate" runat="server" onItemDataBound="dg_Slate_OnItemDataBound" AutoGenerateColumns="false" Style="position:  relative" DataSourceID="SqlDataSource1">
            <asp:BoundColumn DataField="sponsor_pref" ReadOnly="True"></asp:BoundColumn>
            <asp:BoundColumn DataField="Bin" ReadOnly="True"></asp:BoundColumn>
            <asp:BoundColumn DataField="adesig" ReadOnly="True"></asp:BoundColumn>
I  have the following code for the onItemDataBound event
 protected void dg_Slate_OnItemDataBound(object sender, DataGridCommandEventArgs e)
            if (e.Item.ItemType == ListItemType.AlternatingItem | e.Item.ItemType == ListItemType.Item)
                Label r = (Label)e.Item.FindControl("slate_check_label");

                r.Text = "<input type=radio name = 'myradiogroup' value=" + ((DataRowView)e.Item.DataItem).Row.ItemArray[1].ToString() + ">";
Everything I read says this should work but I get the error listed.
Need help fast.  This is driving me crazy.
Question by:mbart
    1 Comment
    LVL 24

    Accepted Solution

    Your method should be like this

    protected void dg_Slate_OnItemDataBound(object sender, DataGridItemEventArgs e)

    instead of DataGridCommandEventArgs.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now