This is a migrated thread and some comments may be shown as answers.

ItemCommand in RadGrid edit form not working

1 Answer 185 Views
This is a migrated thread and some comments may be shown as answers.
Marcus Eddy
Top achievements
Rank 1
Marcus Eddy asked on 15 Feb 2016, 01:38 AM

I've a RadGrid where I'm using the edit form template editing mode, within a user control (Edit.ascx). The user control is part of a custom module for DNN. Whenever I click the Edit button in the generated edit column, the ItemCommand event triggers successfully, however the item command isn't triggered at all upon clicking the Update or Cancel buttons, instead the page posts back to another page control (View.ascx). The ItemCommand handler is a simple stub method; it does nothing.

My grid markup is as follows:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" DataKeyNames="UniqueID"
    GroupPanelPosition="Top" AllowAutomaticUpdates="True" AutoGenerateEditColumn="True" OnItemCommand="RadGrid1_OnItemCommand">
            <telerik:GridBoundColumn DataField="Address" HeaderText="Address" FilterControlAltText="Filter Address column" UniqueName="Address">
            <telerik:GridBoundColumn DataField="LandArea" HeaderText="Land Area" FilterControlAltText="Filter Land Area column" UniqueName="LandArea">
        <EditFormSettings EditFormType="Template">
                <dnn:label ID="Label2" runat="server" Text="Land Area" />
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("LandArea") %>'></asp:TextBox>
                <asp:CompareValidator ControlToValidate="TextBox1" runat="server" ErrorMessage="Numbers only please" Operator="DataTypeCheck" Type="Double"></asp:CompareValidator>
                <dnn:label ID="Label3" runat="server" Text="Other features" /><br/>
                <dnn:texteditor ID="otherFeatures" runat="server" Text='<%# Bind("OtherFeatures") %>'></dnn:texteditor>
                <asp:LinkButton runat="server" ID="btnUpdate" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'></asp:LinkButton>
                <asp:LinkButton runat="server" ID="btnCancel" CommandName="Cancel" CausesValidation="False" Text="Cancel"></asp:LinkButton>

Interestingly, if I implement a similar set up using a standard ASP GridView, the commands work correctly, as expected. However, this doesn't allow me to customise the form as does the RadGrid. Any ideas? I first used the version of Telerik.Web.UI provided with DNN (2013.2.717.40), however upon upgrading to the latest version (2016.1.113.45), the behaviour doesn't change.

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 17 Feb 2016, 12:34 PM
Hello Marcus,

I am afraid we stop supporting DNN since Q2 2013 version of the controls. In case the issue is observed only when using a DNN modules I would suggest you to post your question in their forums.

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Marcus Eddy
Top achievements
Rank 1
Answers by
Telerik team
Share this question