GridView Template field event handler not working in Sitefin

Posted by Community Admin on 04-Aug-2018 13:56

GridView Template field event handler not working in Sitefinity

All Replies

Posted by Community Admin on 15-Jul-2011 00:00

<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,

Posted by Community Admin on 20-Jul-2011 00:00

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

This thread is closed