Here is the workaround I used:
telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function RequestStart(sender, args) {
var re = new RegExp("\.lnkDownloadTekst$|\.lnkDownload$|\.btnDownArrow$|\.btnUpArrow$", "ig");
if (args.get_eventTarget().match(re)) {
args.set_enableAjax(false);
}
}
</script>
</telerik:RadScriptBlock>
In RadAjaxManager I have the "OnRequestStart" client event as follows:
<telerik:RadAjaxManager ID="RadAjaxManager1" EnablePageHeadUpdate="false" runat="server">
<AjaxSettings>
.
.
.
</AjaxSettings>
<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</telerik:RadAjaxManager>
And then the GridView with the buttons that should do a full postback:
<asp:GridView
id="gvVedleggListe"
DataKeyNames="brukerinnhold_id, artikkel_id, filnavn"
OnRowCommand="gvVedleggListe_RowCommand"
Visible="true"
runat="server"
SkinID="NoHeaderNoFooterNoPageSize">
<Columns>
<asp:TemplateField HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="lnkDownloadTekst" runat="server" CommandName="Download" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CausesValidation="false" Text='<%#Eval("Tekst") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="lnkDownload" runat="server" CommandName="Download" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CausesValidation="false" Text="<%$ Resources: Resource, lnkDownload %>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Workaround for ASP.NET AJAX
You can create a PostBackTrigger in the UpdatePanel for the button that initiates postback:
<asp:UpdatePanel runat="server" id="UpdatePanel1">
<ContentTemplate >
<telerik:RadUpload runat="server" id="RadUpload1" />
<asp:Button runat="server" id="ButtonSubmit" text="Postback" />
</ContentTemplate >
<triggers>
<asp:PostbackTrigger controlid ="ButtonSubmit" />
</triggers>
</asp:UpdatePanel>
Workaround for RadAjaxPanel or RadAjaxManager
Attach an event handler to the OnRequestStart client-side event of the RadAjaxPanel / RadAjaxManager, which disables the AJAX functionality when a specific button is clicked.
NB! The get_eventTarget() method of the args parameter contains the UniqueID of the clicked button.
<RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
// on upload button click temporarily disables ajax to perform
// upload actions
function conditionalPostback(sender, args)
{
if (args.get_eventTarget() == "<%= ButtonSubmit.UniqueID %>")
{
args.set_enableAjax(false);
}
}
</script>
</RadScriptBlock>
<telerik:RadAjaxPanel runat="server" id="RadAjaxPanel1"
ClientEvents-OnRequestStart="conditionalPostback">
<telerik:RadUpload runat="server" id="RadUpload1" />
<asp:Button id="ButtonSubmit" runat="server" text="Upload" />
</telerik:RadAjaxPanel>
Workaround for RadGrid for ASP.NET AJAX
Since RadGrid for ASP.NET AJAX no longer supports the EnableAjax feature, one possible way of ajax-ifying it is by placing it inside a RadAjaxPanel for example (the workaround is similar when using RadAjaxManager).
If you have button or other control, which normally does postbacks, placed in the ajax-ified RadGrid you need to attach an event handler for the OnRequestStart client-side event of the RadAjaxPanel (RadAjaxManager), which will disable the AJAX functionality if a specific button is clicked. What is more AJAX can be disabled only if there are files selected for upload. For this purpose the client ID of the RadUpload is stored in a global client-side variable as the Grid triggered in Edit Mode.
<telerik:radscriptblock id="RadScriptBlock1" runat="server">
<script type="text/javascript">
//On insert and update buttons click temporarily disables ajax to perform upload actions
function conditionalPostback(sender, args)
{
var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
if (args.get_eventTarget().match(theRegexp))
{
var upload = $find(window['UploadId']);
//AJAX is disabled only if file is selected for upload
if(upload.getFileInputs()[0].value != "")
{
args.set_enableAjax(false);
}
}
}
</script>
</telerik:radscriptblock>
<telerik:radajaxpanel id="RadAjaxPanel1" runat="server" clientevents-onrequeststart="conditionalPostback">
<telerik:radprogressmanager id="RadProgressManager1" runat="server"/>
<telerik:radgrid runat="server" id="RadGrid1" onitemdatabound="RadGrid1_ItemDataBound">
<mastertableview>
<columns>
<telerik:grideditcommandcolumn />
<telerik:gridtemplatecolumn uniquename="Upload">
<itemtemplate> ... </itemtemplate>
<edititemtemplate>
<telerik:radupload id="RadUpload1" runat="server" />
</edititemtemplate>
</telerik:gridtemplatecolumn>
</columns>
<editformsettings>
<editcolumn uniquename="EditCommandColumn1"></editcolumn>
</editformsettings>
</mastertableview>
</telerik:radgrid>
<telerik:radajaxpanel>
And here is the C# code:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
RadUpload upload = e.Item.FindControl("RadUpload1") as RadUpload;
RadAjaxPanel1.ResponseScripts.Add(string.Format("window['UploadId'] = '{0}';", upload.ClientID));
}
}