var executingAssembly = Assembly.GetExecutingAssembly();//executingAssembly = {App_Web_serversummaryedit.ascx.e5f4f472.hriathhs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null} var webResourceDataArray = NavigationHelper.WebResourceData(webResourceCssPath).Split('|'); var webResourceName = webResourceDataArray[webResourceDataArray.Length - 1];//webResourceName = Telerik.Web.UI.Skins.Grid.css var resourceStream = executingAssembly.GetManifestResourceStream(webResourceName); if (resourceStream != null) { var cssTextStreamReader = new StreamReader(resourceStream); cssText.Append(cssTextStreamReader.ReadToEnd()); }<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %><%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %><%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %><%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %><%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.ComboboxExamplesCS.MultipleComboBoxes.DefaultCS" Language="c#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag> <link rel="stylesheet" type="text/css" href="styles.css" /></head><body class="BODY"> <form runat="server" id="mainForm" method="post"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <qsf:Header runat="server" ID="Header1" NavigationLanguage="C#"></qsf:Header> <div id="qsfexWrapper"> <asp:Label runat="server" AssociatedControlID="RadComboBox1">Continent:</asp:Label> <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="186px" CssClass="ComboBox_Continents" OnClientSelectedIndexChanging="LoadCountries" OnItemsRequested="RadComboBox1_ItemsRequested" /> <asp:Label runat="server" AssociatedControlID="RadComboBox2">Country:</asp:Label> <telerik:RadComboBox ID="RadComboBox2" runat="server" EnableViewState="false" Width="186px" CssClass="ComboBox_Countries" OnClientSelectedIndexChanging="LoadCities" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="RadComboBox2_ItemsRequested" /> <asp:Label runat="server" AssociatedControlID="RadComboBox3">City:</asp:Label> <telerik:RadComboBox ID="RadComboBox3" CheckBoxes="true" runat="server" EnableViewState="false" Width="186px" CssClass="ComboBox_Cities" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="RadComboBox3_ItemsRequested" /> <span class="Button_Submit"> <telerik:RadButton ID="Button1" runat="server" Text="Explore" OnClick="Button1_Click" /> </span> <asp:Label runat="server" ID="Literal1" CssClass="Label_Result" /> </div> <script type="text/javascript">//global variables for the countries and cities comboboxesvar countriesCombo;var citiesCombo;function pageLoad(){ // initialize the global variables // in this event all client objects // are already created and initialized countriesCombo = $find("<%= RadComboBox2.ClientID %>"); citiesCombo = $find("<%= RadComboBox3.ClientID %>");}function LoadCountries(sender, eventArgs){ var item = eventArgs.get_item(); countriesCombo.set_text("Loading..."); citiesCombo.clearSelection(); // if a continent is selected if (item.get_index() > 0) { // this will fire the ItemsRequested event of the // countries combobox passing the continentID as a parameter countriesCombo.requestItems(item.get_value(), false); } else { // the -Select a continent- item was chosen countriesCombo.set_text(" "); countriesCombo.clearItems(); citiesCombo.set_text(" "); citiesCombo.clearItems(); }}function LoadCities(sender, eventArgs){ var item = eventArgs.get_item(); citiesCombo.set_text("Loading..."); // this will fire the ItemsRequested event of the // cities combobox passing the countryID as a parameter citiesCombo.requestItems(item.get_value(), false); }function ItemsLoaded(sender, eventArgs){ if (sender.get_items().get_count() > 0) { // pre-select the first item sender.set_text(sender.get_items().getItem(0).get_text()); sender.get_items().getItem(0).highlight(); } sender.showDropDown();} </script> <qsf:Footer runat="server" ID="Footer1"></qsf:Footer> </form></body></html>using System;using System.Configuration;using System.Data;using System.Data.SqlClient;using Telerik.Web.UI;namespace Telerik.ComboboxExamplesCS.MultipleComboBoxes{ public partial class DefaultCS: System.Web.UI.Page { private const string MessageTemplate = "You chose to explore the city of {0} in {1}, {2}"; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) // Fill the continents combo. LoadContinents(); else if (!Page.IsCallback) { // On regular postbacks restore the items of the related ComboBoxes. // Their selected items will be automatically restored from their ClientState. LoadCountries(RadComboBox1.SelectedValue); LoadCities(RadComboBox2.SelectedValue); } } protected void LoadContinents() { SqlConnection connection = new SqlConnection( ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString); SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Continents ORDER By Name", connection); DataTable dt = new DataTable(); adapter.Fill(dt); RadComboBox1.DataTextField = "Name"; RadComboBox1.DataValueField = "ID"; RadComboBox1.DataSource = dt; RadComboBox1.DataBind(); // Insert the first item. RadComboBox1.Items.Insert(0, new RadComboBoxItem("- Select a continent -")); } protected void LoadCountries(string continentID) { SqlConnection connection = new SqlConnection( ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString); // Select a country based on the continentID. SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Countries WHERE ContinentID=@ContinentID ORDER By Name", connection); adapter.SelectCommand.Parameters.AddWithValue("@ContinentID", continentID); DataTable dt = new DataTable(); adapter.Fill(dt); RadComboBox2.DataTextField = "Name"; RadComboBox2.DataValueField = "ID"; RadComboBox2.DataSource = dt; RadComboBox2.DataBind(); } protected void LoadCities(string countryID) { SqlConnection connection = new SqlConnection( ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString); // Select a city based on the countryID. SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Cities WHERE CountryID=@CountryID ORDER By Name", connection); adapter.SelectCommand.Parameters.AddWithValue("@CountryID", countryID); DataTable dt = new DataTable(); adapter.Fill(dt); RadComboBox3.DataTextField = "Name"; RadComboBox3.DataValueField = "ID"; RadComboBox3.DataSource = dt; RadComboBox3.DataBind(); } protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { LoadContinents(); } protected void RadComboBox2_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { // e.Text is the first parameter of the requestItems method // invoked in LoadCountries method LoadCountries(e.Text); } protected void RadComboBox3_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { // e.Text is the first parameter of the requestItems method // invoked in LoadCities method LoadCities(e.Text); } protected void Button1_Click(object sender, EventArgs e) { Literal1.Text = string.Empty; if (RadComboBox1.SelectedIndex > 0) Literal1.Text = string.Format(MessageTemplate, RadComboBox3.Text, RadComboBox2.Text, RadComboBox1.Text); } }}
I have Explorer.aspx that defines a RadWindowManager as seen below:
<telerik:RadWindowManager ID="radWinMgr" runat="server" AutoSize="true" EnableShadow="true" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false" OnClientClose="fncClientClose"> <Windows> <telerik:RadWindow ID="rwUploadParent" runat="server" Behaviors="Close" NavigateUrl="Upload.aspx"></telerik:RadWindow> <telerik:RadWindow ID="rwDownloadParent" runat="server" Behaviors="Close" NavigateUrl="Download.aspx"></telerik:RadWindow> </Windows></telerik:RadWindowManager>
The OnClientClose function that you see referenced above is defined as follows:
<script type="text/javascript"> function fncClientClose(winNewRep, args) { var arg = args.get_argument(); if (arg == 1) { //Refresh file explorer: var oExplorer = $find("<%=radExplorer.ClientID%>"); var dirPath = oExplorer.get_currentDirectory(); if (dirPath) oAjaxPanel.ajaxRequest(dirPath); } }</script>
The purpose of the function is to refresh the RadFileExplorer, but this function never gets called. I have a button click the opens Upload.aspx as a RadWindow as follows:
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClientClick="fncOpenPopupWin('UploadMgr.aspx?UpFolder=', 'rwUploadParent'); return false;" />
As you see the OnClientClick of the button calls another function and passes the page name to open, including a query string parameter, and the name of the RadWindow:
<script type="text/javascript"> function fncOpenPopupWin2(strPage, strParent) { var varLocation = "/Root"; var winNewRep = radopen(strPage + varLocation, strParent); }</script>
When the button is clicked, page Upload.aspx opens, the user does what he/she wants, and then closes Upload.aspx. At that point, I expect the OnClientClose of the RadWindownManager to execute, but it never does.
I have read many postings about this kind of problem here on the forum, but none of the solutions have helped my situation. I appreciate any time someone takes to review this and offer suggestions.
Thank you,
Steven
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="False" GridLines="Both" OnNeedDataSource="RadGrid1_needdatasource" OnItemDataBound="RadGrid1_ItemDataBound" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnItemCreated="RadGrid1_ItemCreated" AllowMultiRowSelection="true" AllowFilteringByColumn="true" OnItemCommand="RadGrid1_ItemCommand" SelectedItemStyle-CssClass="SelectedItem" Skin="Default"> <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="true" /> <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true"> <Selecting AllowRowSelect="true" /> </ClientSettings> <FooterStyle BackColor="LightBlue" /> <MasterTableView ShowHeadersWhenNoRecords="true" AllowFilteringByColumn="true" DataKeyNames="RequestInfoID" Name="ApprovalsMaster"> <DetailTables> <telerik:GridTableView DataKeyNames="RequestInfoID" Width="80%" Name="ApprovalsDetail" AllowPaging="false" runat="server"> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="RequestInfoID" MasterKeyField="RequestInfoID" /> </ParentTableRelation> <Columns> <telerik:GridBoundColumn SortExpression="ApprovalLevelID" HeaderText="ApprovalLevelID" HeaderButtonType="TextButton" DataField="ApprovalLevelID" UniqueName="ApprovalLevelID"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn HeaderText="Approve" UniqueName="ApproveRequest" AllowFiltering="false"> <ItemTemplate> <asp:Button runat="server" ID="btnApproveRequest" Text="Approve" CssClass="ButtonCSS" ToolTip="Click here to Approve Request" CausesValidation="False" OnClick="btnApproveRequest_Click" OnClientClick="javascript:var agree= confirm('Are you sure you want to approve this Request? '); if(agree){ Page_BlockSubmit = false;buttonClicked_WithObj(this); return true; };else {return false;};" CommandArgument='<%# Eval ( "RequestInfoID").ToString() + ";" + Eval ( "ApprovalLevelID").ToString() %>' /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </telerik:GridTableView> </DetailTables> <Columns> <telerik:GridNumericColumn DataField="RequestInfoID" HeaderText="Request No." SortExpression="RequestInfoID" DataType="System.Int64" FilterControlWidth="40px"> </telerik:GridNumericColumn> <telerik:GridBoundColumn DataField="DepartmentName" HeaderText="Department" SortExpression="DepartmentName" UniqueName="DepartmentName"> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <PopUpSettings ScrollBars="None" /> </EditFormSettings> <ExpandCollapseColumn Resizable="False" Visible="False"> <HeaderStyle /> </ExpandCollapseColumn> <RowIndicatorColumn Visible="False"> <HeaderStyle /> </RowIndicatorColumn> </MasterTableView> </telerik:RadGrid> OnDataBound="RadGrid1_DataBound" OnDataBinding="RadGrid1_DataBinding" protected void RadGrid1_DataBound(object sender, EventArgs e) { LoadGroupsExpandedState(RadGrid1); } protected void RadGrid1_DataBinding(object sender, EventArgs e) { SaveGroupsExpandedState(RadGrid1); } private void SaveGroupsExpandedState(RadGrid grid) { GridItem[] groupItems = grid.MasterTableView.GetItems(GridItemType.GroupHeader); if (groupItems.Length > 0) { List<string> collapsedIndexes = new List<string>(); foreach (GridItem item in groupItems) { if (!item.Expanded) { GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)item; collapsedIndexes.Add(groupHeader.DataCell.Text); } } Session["groupExpandedState"] = collapsedIndexes; } } private void LoadGroupsExpandedState(RadGrid grid) { List<string> collapsedIndexes = Session["groupExpandedState"] as List<string>; if (collapsedIndexes != null) { foreach (GridItem item in grid.MasterTableView.GetItems(GridItemType.GroupHeader)) { GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)item; if (collapsedIndexes.Contains(groupHeader.DataCell.Text)) { item.Expanded = false; } } } } public DataTable ProductDetailsDataTable{ get { return _productDetailsDataTable; } set { _productDetailsDataTable = value; //add code to read data from table and do something with it DataRow dr = _productDetailsDataTable.Rows[0]; RadImageEditor1.ImageUrl = dr["Image1Url"].ToString(); }}
<radA:RadAjaxManager runat="server" ID="radAjax" DefaultLoadingPanelID="AjaxLoadingPanel1" >
<AjaxSettings>
<rada:AjaxSetting AjaxControlID="RadGrid_NoReferrals">
<UpdatedControls>
<rada:AjaxUpdatedControl ControlID="RadGrid_NoReferrals" />
</UpdatedControls>
</rada:AjaxSetting>
</AjaxSettings>
</radA:RadAjaxManager>
Our circumstances:
Our Issue:
When we would attempt an export to PDF and we were setting the "ignorepaging" to true (as suggested in numerous posts), but we were still getting a Telerik error message. Doing searches through the system did not give us the exact resolution to the problem so alot of troubleshooting went on to resolve it.
Our Resolution:
Example:
myDataList.ExportSettings.ExportOnlyData = false;myDataList.ExportSettings.IgnorePaging = true;myDataList.ExportSettings.OpenInNewWindow = true;myDataList.ExportSettings.FileName = "Some_Name";myDataList.ExportSettings.Pdf.PageWidth = 1200;myDataList.Rebind();myDataList.MasterTableView.ExportToPdf();