or

protected void OnDetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; int customerid = Convert.ToInt32(dataItem.GetDataKeyValue("customerid")); RadPanelBar panelBar = (RadPanelBar)dataItem.ChildItem.FindControl("pbCustomerDetails"); using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["LocalConnectionString"].ConnectionString)) { using (SqlCommand myCommand = new SqlCommand("", conn)) { myCommand.CommandText = "Select DateOfBirth, WorkAddress from CustomerDetail where Active=1 and CustomerID=@CustomerID "; myCommand.Parameters.Add("@CustomerID", SqlDbType.Int).Value = customerid; using (SqlDataAdapter adapter = new SqlDataAdapter(myCommand)) { DataTable table = new DataTable(); conn.Open(); adapter.Fill(table); conn.Close(); panelBar.DataSource = table; panelBar.DataBind(); for (int i = 0; i < panelBar.Items.Count; i++) { panelBar.Items[i].ContentTemplate = new CustomerTemplate(); panelBar.Items[i].ContentTemplate.InstantiateIn(panelBar.Items[i]); panelBar.Items[i].DataBind(); panelBar.Items[i].Expanded = true; } panelBar.DataBind(); e.DetailTableView.DataSource = table; } } } }protected void Page_Load(object sender, EventArgs e) { foreach (GridDataItem item in CustomerGrid.Items) { if (item.Expanded) { RadPanelBar panelBar = (RadPanelBar)item.ChildItem.FindControl("pbCustomerDetails"); for (int i = 0; i < panelBar.Items.Count; i++) { panelBar.Items[i].ContentTemplate = new CustomerTemplate(); panelBar.Items[i].ContentTemplate.InstantiateIn(panelBar.Items[i]); panelBar.Items[i].DataBind(); } panelBar.DataBind(); } } }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"