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

Multiple RadButtons in FormTemplate not firing ItemCommand event

3 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason Sheats
Top achievements
Rank 1
Jason Sheats asked on 30 Nov 2011, 11:17 PM

<EditFormSettings InsertCaption="Assign/Modify Question" CaptionFormatString="Edit Record: {0}" 

 

 

CaptionDataField="QuestionId" EditFormType="Template">

 

 

<PopUpSettings Modal="True" Width="700px" Height="500px" />

 

 

<FormTemplate>

 

 

<asp:ValidationSummary ID="valSummaryApprove" ValidationGroup="ApproveGroup" ForeColor="DarkRed"

 BackColor="Transparent" runat="server" Width="550px" Font-Names="Verdana" Font-Size="8pt"

 TabIndex="-1" HeaderText="Validation Results" />

 

 

<asp:ValidationSummary ID="valSummaryReassign" ValidationGroup="ReassignGroup" ForeColor="DarkRed"

 BackColor="Transparent" runat="server" Width="550px" Font-Names="Verdana" Font-Size="8pt"

 TabIndex="-1" HeaderText="Validation Results" />

 

 

<asp:ValidationSummary ID="valSummary" ValidationGroup="UpdateGroup" ForeColor="DarkRed"

 BackColor="Transparent" runat="server" Width="550px" Font-Names="Verdana" Font-Size="8pt"

 TabIndex="-1" HeaderText="Validation Results" />



<table>
...

 <tr>

 <td>

 

<telerik:RadButton ID="RadButton1" ValidationGroup="ApproveGroup" TabIndex="14" CausesValidation="true" AutoPostBack="false"  Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Approve for Public Release" %>' runat="server" Skin="Web20"

 CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>

 </telerik:RadButton></td>

 

 

 <td>

 
<telerik:RadButton ID="RadButton2" ValidationGroup="ReassignGroup" TabIndex="15" CausesValidation="true" AutoPostBack="false" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Reassign" %>' runat="server" Skin="Web20"  

CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>

 </telerik:RadButton></td>

 

 

 <td>

 
<telerik:RadButton ID="Button1" ValidationGroup="UpdateGroup" TabIndex="16" CausesValidation="true"

Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" Skin="Web20"

 CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>

</telerik:RadButton></td><td><telerik:RadButton ID="btnCancel" CommandName="Cancel" TabIndex="17" Text="Cancel" CausesValidation="False"

 runat="server" Skin="Web20"></telerik:RadButton></td>

 

 

 </tr>

</table>

 

Approve for Public Release and Reassign buttons do not fire itemcommand event unless I set autopostback to true, which loses my edits.

 

 

 

 

Please help.

Thanks in advance...
...
</table>

 

3 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 05 Dec 2011, 03:18 PM
Hello Jason,

In order to fire the server-side PerformInsert / Update commands, you need to set the AutoPostBack properties of the buttons to true.
If the data is lost, please make sure that you follow these help topics when updating:
Updating Values Using InPlace and EditForms Modes
Updating Values Using UserControl/FormTemplate

I hope this helps.

Best wishes,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Dec 2011, 03:22 PM
Hello Jason,

First try with the solution which was given by mira.
 
If this is not worked then try with below code.If below code is worked for you then please check any other validation fired when you click on update or insert button.

<telerik:RadButton ID="Button1" CausesValidation="False" />

Thanks,
Jayesh Goyani
0
T
Top achievements
Rank 1
answered on 15 May 2012, 06:01 PM
good tip, Jayesh.  I had a control in a multipage which was trying to validate and stopping the page from updating.
Tags
Grid
Asked by
Jason Sheats
Top achievements
Rank 1
Answers by
Mira
Telerik team
Jayesh Goyani
Top achievements
Rank 2
T
Top achievements
Rank 1
Share this question
or