• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3527
  • Last Modified:

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

I have a datagrid
<asp:datagrid ID="dg_Slate" runat="server" onItemDataBound="dg_Slate_OnItemDataBound" AutoGenerateColumns="false" Style="position:  relative" DataSourceID="SqlDataSource1">
        <Columns>
            <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>
        </Columns>
    </asp:datagrid>
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.
0
mbart
Asked:
mbart
1 Solution
 
DBAduck - Ben MillerPrincipal ConsultantCommented:
Your method should be like this

protected void dg_Slate_OnItemDataBound(object sender, DataGridItemEventArgs e)

instead of DataGridCommandEventArgs.

Ben.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now