With the solution in place for the previous issue (see below), we are now experiencing the failure of the RadGrid "cancel" button to hit the server side. I can add an OnClientClick attribute to the asp:Button control to fire a JavaScript alert, but the server side Grid_ItemCommand (and even Page_Load) handler breakpoints are not being hit. Any thoughts would be greatly appreciated. Thank you. Version 2010.3.1109.35
Previous Issue: http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-insert-edit-fails-validation-cancel-tab-change.aspx
Previous Issue: http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-insert-edit-fails-validation-cancel-tab-change.aspx
4 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 06 Jun 2011, 08:23 AM
Hello Thomas,
I am not quite sure about your scenario. I hope this help document will help you to solve the issue.
Confirmation dialogs.
Please elaborate your scenario if it doesn't help.
Thanks,
Shinu.
I am not quite sure about your scenario. I hope this help document will help you to solve the issue.
Confirmation dialogs.
Please elaborate your scenario if it doesn't help.
Thanks,
Shinu.
0

THOMAS
Top achievements
Rank 1
answered on 06 Jun 2011, 07:24 PM
<script type="text/javascript">
// ensure that the current tab passes validations before changing tabs
function MatterTabSelecting(sender, eventArgs) {
if (typeof (Page_ClientValidate) == 'function') {
Page_ClientValidate();
if (!Page_IsValid)
eventArgs.set_cancel(true);
}
return false;
}
</script>
<
telerik:RadTabStrip
ID
=
"MatterTabStrip"
runat
=
"server"
MultiPageID
=
"MatterDetailMultiPage"
SelectedIndex
=
"0"
CausesValidation
=
"true"
OnClientTabSelecting
=
"MatterTabSelecting"
> ...
<
telerik:RadPageView
ID
=
"ExpensesView"
runat
=
"server"
>
<
asp:UpdatePanel
ID
=
"ExpensesUpdatePanel"
runat
=
"server"
>
<
ContentTemplate
>
<
telerik:RadGrid
... >
<
MasterTableView
... >
<
PagerStyle
... >
<
Columns
>...</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
asp:Button
ID
=
"Button2"
runat
=
"server"
Text
=
"Cancel"
CausesValidation
=
"false"
CommandName
=
"Cancel"
/>
If the validations fail upon attempting to change tabs, the selection is canceled properly. However, when attempting to cancel the Insert or Update (after the validation canceled attempted tab change), nothing happens. If you click the Cancel button again, all event occur normally. An added JavaScript alert for the OnClientClick event for the Cancel button will fire both times; any server-side breakpoints will not be hit until the second click.
(NOTE: I've also attempted to return true in MatterTabSelecting.)
0
Do you get the same behavior with AJAX disabled? I suggest you try to get this scenario working without any AJAX behavior and then add up AJAX. Also validation controls may cause issues with the UpdatePanel, so you may want to try with RadAjaxPanel instead.
Veli
the Telerik team
Veli
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

THOMAS
Top achievements
Rank 1
answered on 09 Jun 2011, 11:03 PM
I'm not sure what the root cause of the problem is (though it must relate to the AJAX and ASP Validators), but I was able to utilize this thread to create a work around.
Now the "Cancel" button works as expected.
<
asp:Button
ID
=
"btnCancelMatterUpdate"
runat
=
"server"
OnClick
=
"btnCancelMatterUpdate_Click"
Text
=
"Cancel"
CausesValidation
=
"false"
OnClientClick
=
"javascript:Page_ValidationActive = false;"
/>
Now the "Cancel" button works as expected.