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"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Address"
HeaderText
=
"Address"
FilterControlAltText
=
"Filter Address column"
UniqueName
=
"Address"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LandArea"
HeaderText
=
"Land Area"
FilterControlAltText
=
"Filter Land Area column"
UniqueName
=
"LandArea"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
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
>
</
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.