1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / GridView Template field event handler not working in Sitefinity

GridView Template field event handler not working in Sitefinity

2 posts, 0 answered
  1. Mohamed
    Mohamed avatar
    15 posts
    Registered:
    24 Oct 2010
    15 Jul 2011
    Link to this post
    <asp:GridView runat="server" ID="grdJobs" AutoGenerateColumns="true" >
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton runat="server" ID="img" OnClick="imgEdit_Command"ImageUrl="~/img" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
     
    protected void imgEdit_Command(object sender, ImageClickEventArgs e)
            {
                btn.Text = "jhgjhgj";
            }

    Hello,

    I have a very simple GridView with a template field (Image Button).

    The user control works fine when put in a website outside sitefinity, but when I embedded the user control in a sitefinity backend page, when I click on the image button the event is not fired.

    I tried different command event handling for asp gridview and radGrid, they all work outside sitefinity and none of the works when embedded in sitefinity.

    I don't know where is the problem is, so help is highly appreciated.

    Thanks,
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    20 Jul 2011
    Link to this post
    Hi Mohamed,

    Since the control is working fine when placed on an external page, there should be no problem using in on a Sitefinity page. Can you please make sure that you have EnableViewState checked form the page's title and properties?

    All the best,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered