or
protected void rgDemandForecast_OnItemCreated(object source, GridItemEventArgs e) { if (e.Item is Telerik.Web.UI.GridEditFormItem && e.Item.IsInEditMode) { LinkButton linkButton = new LinkButton(); linkButton.Text = "Update And Edit Next Row"; linkButton.CommandName = "Update"; linkButton.Attributes["onclick"] = "some javascript"; //or
linkButton.Click += updateAndEditNextRow_OnClick;
LinkButton update = e.Item.FindControl("UpdateButton") as LinkButton; update.Parent.Controls.Add(new LiteralControl(" ")); update.Parent.Controls.Add(linkButton); } }EnablePostBackOnRowClick = true.
function IW_RowSelected(sender, eventArgs) { var e = eventArgs.get_domEvent(); if (!sender.AllowMultiRowSelection || !e.shiftKey) { // Multiple row not enabled or shift not pressed, nothing to do return; } if (window.rowSelectedTimeout) { // If selecting multiple rows, clear the previous row's rowSelectedTimeout window.clearTimeout(window.rowSelectedTimeout); } rowSelectedTimeout = window.setTimeout(function() { window.rowSelectedTimeout = null; alert('rows selected'); // Should force a postback here }, 10); }
As you can see in the enclosed image I want the user be able to download a file. (radlistview.png)
When I enable AJAX an error occurs (error.png).
I use the following code:
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> <telerik:RadAjaxManagerProxy ID="rampRequest" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="paRequestListView"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="paRequestListView" LoadingPanelID="raLoadingPanel"></telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManagerProxy> <asp:Panel ID="paRequestListView" runat="server"> <NMHG:RequestListView id="RequestListView" runat="server"></NMHG:RequestListView> </asp:Panel> </asp:Content>
protected void rlvRequest_ItemCommand(object source, RadListViewCommandEventArgs e)
{
//Download file
if (e.CommandName == "Download")
{
//show save as dialog
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename=" + RequestDownloadFileName + ";");
response.TransmitFile(ConfigurationManager.AppSettings.Get("Download directory") + RequestDownloadFileName);
response.End();
}
}
When I remove the <telerik:RadAjaxManagerProxy> tag from the code above i am able to download the file.
Any idea why my download not works when AJAX is enabled?
I also noticed the LoadingPanel for my RadListView is never shown. AJAX functions normal in my RadListView.
I use the same code for my RadGrids were the LoadingPanel is shown.
Regards,
Marcel
<rad:RadGrid ID="rgUserList" runat="server" Width="100%" AutoGenerateColumns="false"AllowPaging="true" PageSize="10" PagerStyle-Mode="NextPrevAndNumeric" EnableTheming="true"GridLines="Vertical" OnItemDataBound="rgUserList_ItemDataBound" AllowSorting="true"AllowFilteringByColumn="false" OnNeedDataSource="rgUserList_NeedDataSource"
<center> <div id="divloading" style="z-index: 9000;"> <table class="centertable" border="0" style="width: 400px;" cellpadding="0" cellspacing="0"> <tr> <td style="text-align: center;"> <center><telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" HorizontalAlign="Center" runat="server" Skin="Outlook" MinDisplayTime="1500" IsSticky="True" Style="position: absolute; top: 0; left: 0; height: 100%; width: 100%;" Transparency="20" > <img src="ajaxloadingpanel_images/Loading.gif" title="Processing..." /> </telerik:RadAjaxLoadingPanel> </center> </td> </tr> </table></div></center>