Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 99250

ItemCommand in RadGrid edit form not working

$
0
0

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:RadGridID="RadGrid1"runat="server"DataSourceID="ObjectDataSource1"AutoGenerateColumns="False"DataKeyNames="UniqueID"
    GroupPanelPosition="Top"AllowAutomaticUpdates="True"AutoGenerateEditColumn="True"OnItemCommand="RadGrid1_OnItemCommand">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumnDataField="Address"HeaderText="Address"FilterControlAltText="Filter Address column"UniqueName="Address">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumnDataField="LandArea"HeaderText="Land Area"FilterControlAltText="Filter Land Area column"UniqueName="LandArea">
            </telerik:GridBoundColumn>
        </Columns>
 
        <EditFormSettingsEditFormType="Template">
            <FormTemplate>
                <dnn:labelID="Label2"runat="server"Text="Land Area"/>
                <asp:TextBoxID="TextBox1"runat="server"Text='<%# Bind("LandArea") %>'></asp:TextBox>
                <asp:CompareValidatorControlToValidate="TextBox1"runat="server"ErrorMessage="Numbers only please"Operator="DataTypeCheck"Type="Double"></asp:CompareValidator>
                <dnn:labelID="Label3"runat="server"Text="Other features"/><br/>
                <dnn:texteditorID="otherFeatures"runat="server"Text='<%# Bind("OtherFeatures") %>'></dnn:texteditor>
                <asp:LinkButtonrunat="server"ID="btnUpdate"CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'></asp:LinkButton>
                <asp:LinkButtonrunat="server"ID="btnCancel"CommandName="Cancel"CausesValidation="False"Text="Cancel"></asp:LinkButton>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>
 

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.


Viewing all articles
Browse latest Browse all 99250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>