Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
129 views

I have a radgrid where I am exporting to Excel.
The RadprogressBarArea increments just fine to 99 percent then stops. (CommandItemTemplate imagebutton click event fires the export process)
After a moment the open,save or cancel window opens for the excel export process..
I save save it or etc...
The progress area never goes away.
Someone suggested reloading the page (not an option).
I have looked at various java script options and other forum post,  but I am having problems following them.

Anyone else run across this and know of a good link?

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/NoNav.Master" AutoEventWireup="true" 
    CodeBehind="Sites.aspx.cs" Inherits="TIPWebIT.SiteManagement.Sites" %> 
 
<%@ Register TagPrefix="custom" Namespace="TIPWebCommon.FilteringTemplateColumns" 
    Assembly="TIPWebIT" %> 
<%@ MasterType TypeName="TIPWebCommon.MasterPages.HayesMasterPage" %> 
<%@ Register Src="SiteDetails.ascx" TagName="SiteDetails" TagPrefix="uc1" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
 
        <script type="text/javascript">  
             
            function RequestStarted(ajaxManager, eventArgs) {  
                if (eventArgs.EventTarget.indexOf("ExportToExcel") != -1) {  
                    eventArgs.EnableAjax = false;  
                }  
            }  
            function OpenWindow(windowName) {  
                window.radopen("", windowName);  
            }  
 
            function Refresh(windowName) {  
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(windowName);  
            }  
 
            function ClosedRadWindowSiteType() {  
                Refresh("RadWindowSiteType");  
            }  
        </script> 
 
    </telerik:RadCodeBlock> 
    <telerik:RadGrid ID="RadGridSites" runat="server" DataSourceID="LdsSites" GridLines="None" 
        AutoGenerateColumns="False" AllowFilteringByColumn="True" AllowPaging="True" 
        AllowSorting="True" OnItemCommand="RadGridSites_ItemCommand" OnItemCreated="RadGridSites_ItemCreated" 
        OnPreRender="RadGridSites_PreRender" OnItemDataBound="RadGridSites_ItemDataBound">  
        <MasterTableView DataKeyNames="SiteUID" DataSourceID="LdsSites">  
            <CommandItemTemplate> 
                <div class="HeaderLeft">  
                    <table> 
                        <tr> 
                            <td> 
                                <asp:ImageButton runat="server" ID="ImageButtonAddRecord" ToolTip="Add Record" AlternateText="Add Record" 
                                    CommandName="InitInsert" /> 
                            </td> 
                            <td> 
                                <asp:LinkButton runat="server" ID="LinkButtonAddRecord" Text="Add Record" CommandName="InitInsert" /> 
                            </td> 
                            <td> 
                                <asp:CheckBox ID="CheckShowInactive" runat="server" EnableViewState="true" AutoPostBack="True" 
                                    OnCheckedChanged="CheckShowInactive_CheckedChanged" /> 
                            </td> 
                            <td> 
                                <asp:LinkButton ID="LinkButtonShowInactive" runat="server" Text="Show Inactive" OnClick="CheckShowInactive_CheckedChanged" /> 
                            </td> 
                        </tr> 
                    </table> 
                </div> 
                <div class="HeaderRight">  
                    <table> 
                        <tr> 
                            <td> 
                                <asp:ImageButton ID="ExportToExcel" runat="server" OnClick="ExportClick" CommandName="ExportToExcel" CssClass="rgExpXLS"/>  
                            </td> 
                            <td> 
                                <asp:ImageButton runat="server" ID="ImageButtonRefresh" ToolTip="Refresh" AlternateText="Refresh" 
                                    CommandName="RebindGrid" /> 
                            </td> 
                            <td> 
                                <asp:LinkButton runat="server" ID="LinkButtonRefresh" Text="Refresh" CommandName="RebindGrid" /> 
                            </td> 
                        </tr> 
                    </table> 
                </div> 
            </CommandItemTemplate> 
            <NestedViewTemplate> 
                <asp:Panel ID="PanelNestedView" runat="server" CssClass="EditFormTabs">  
                    <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">  
                        <Tabs> 
                            <telerik:RadTab runat="server" Text="Site Details">  
                            </telerik:RadTab> 
                        </Tabs> 
                    </telerik:RadTabStrip> 
                    <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">  
                        <telerik:RadPageView runat="server" ID="PageView1">  
                            <uc1:SiteDetails ID="SiteDetails1" runat="server" /> 
                        </telerik:RadPageView> 
                    </telerik:RadMultiPage> 
                </asp:Panel> 
            </NestedViewTemplate> 
            <EditFormSettings UserControlName="SiteDetails.ascx" EditFormType="WebUserControl">  
                <EditColumn UniqueName="EditCommandColumn1">  
                </EditColumn> 
            </EditFormSettings> 
            <ExpandCollapseColumn Visible="True">  
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">  
                    <ItemStyle HorizontalAlign="Center" /> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridTemplateColumn AutoPostBackOnFilter="True" DataField="SiteID" HeaderText="Site ID" 
                    SortExpression="SiteID" UniqueName="SiteID" CurrentFilterFunction="StartsWith" 
                    ShowFilterIcon="False">  
                    <ItemTemplate> 
                        <asp:Label ID="SiteIDLabel" runat="server" Text='<%# Eval("SiteID") %>'></asp:Label>&nbsp;  
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="SiteName" AutoPostBackOnFilter="true" HeaderText="Site Name" 
                    SortExpression="SiteName" UniqueName="SiteName" ShowFilterIcon="False">  
                    <ItemTemplate> 
                        <asp:Label ID="SiteNameLabel" runat="server" Text='<%# Eval("SiteName") %>'></asp:Label>&nbsp;  
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="Contact" HeaderText="Contact" SortExpression="Contact" 
                    UniqueName="Contact" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" 
                    ShowFilterIcon="False">  
                    <ItemTemplate> 
                        <asp:Label ID="ContactLabel" runat="server" Text='<%# Eval("Contact") %>'></asp:Label>&nbsp;  
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="Phone" HeaderText="Phone" SortExpression="Phone" 
                    UniqueName="Phone" Visible="true" AutoPostBackOnFilter="true" EditFormColumnIndex="1" 
                    ShowFilterIcon="False">  
                    <ItemTemplate> 
                        <asp:Label ID="PhoneLabel" runat="server" Text='<%# Eval("Phone") %>'></asp:Label>&nbsp;  
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="Email" HeaderText="Email" SortExpression="Email" 
                    UniqueName="Email" Visible="False" AutoPostBackOnFilter="true" EditFormColumnIndex="1" 
                    ShowFilterIcon="False">  
                    <ItemTemplate> 
                        <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>'></asp:Label>&nbsp;  
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <custom:FilteringColumn UniqueName="Name" SortExpression="Name" DataField="Name" 
                    TableName="LdsSiteTypes" HeaderText="Site Type" ShowFilterIcon="false">  
                    <ItemTemplate> 
                        <asp:Label ID="SiteTypeNameLabel3" runat="server" Text='<%# Eval("Name") %>'></asp:Label> 
                    </ItemTemplate> 
                </custom:FilteringColumn> 
                <custom:FilteringColumn UniqueName="RegionName" SortExpression="RegionName" DataField="RegionName" 
                    TableName="LdsRegions" HeaderText="Region" ShowFilterIcon="false">  
                    <ItemTemplate> 
                        <asp:Label ID="RegionNameLabel3" runat="server" Text='<%# Eval("RegionName") %>'></asp:Label>&nbsp;  
                    </ItemTemplate> 
                </custom:FilteringColumn> 
                <telerik:GridButtonColumn UniqueName="TransferColumn" HeaderText="Transfer" CommandName="Transfer" 
                    ButtonType="ImageButton" Text="Transfer" ImageUrl="~/Images/Transfer.gif">  
                    <ItemStyle HorizontalAlign="Center" /> 
                </telerik:GridButtonColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> 
     <telerik:RadProgressArea ID="RadProgressArea1" Runat="server"   
        CssClass="Progress" DisplayCancelButton="True" Skin="WebBlue" > 
<Localization Uploaded="Uploaded"></Localization> 
    </telerik:RadProgressArea> 
    <br /> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
        <Windows> 
            <telerik:RadWindow ID="RadWindowSiteType" runat="server" Behavior="Resize, Close" 
                InitialBehavior="None" Modal="True" NavigateUrl="SiteTypes.aspx" Title="Edit Site Types" 
                OnClientClose="ClosedRadWindowSiteType">  
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">  
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" 
        ClientEvents-OnRequestStart="RequestStarted">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGridSites" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadGridSites">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGridSites" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <asp:HiddenField ID="HiddenFieldShowInactive" runat="server" Value="False" /> 
    <asp:LinqDataSource ID="LdsSites" runat="server" ContextTypeName="TIPWebITLibrary.DAL.TIPWebITDataContext" 
        TableName="VTechSites" Where="Active != @Active">  
        <WhereParameters> 
            <asp:ControlParameter ControlID="HiddenFieldShowInactive" DefaultValue="False" Name="Active" 
                PropertyName="Value" Type="Boolean" /> 
        </WhereParameters> 
    </asp:LinqDataSource> 
    <asp:LinqDataSource ID="LdsSiteTypes" runat="server" ContextTypeName="TIPWebITLibrary.DAL.TIPWebITDataContext" 
        Select="new (Name, Description, SiteTypeUID)" TableName="tblTechSiteTypes" OrderBy="Name">  
    </asp:LinqDataSource> 
    <asp:LinqDataSource ID="LdsRegions" runat="server" ContextTypeName="TIPWebITLibrary.DAL.TIPWebITDataContext" 
        Select="new (RegionName, RegionDesc, RegionID)" TableName="tblRegions" Where="RegionID > 0" 
        OrderBy="RegionName">  
    </asp:LinqDataSource> 
</asp:Content> 
 



 
 
 
 
 
using System;  
using System.Globalization;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
 
namespace TIPWebIT.SiteManagement  
{  
    public partial class Sites : System.Web.UI.Page  
    {  
        protected void Page_Unload(object sender, EventArgs e)  
        {  
            if (Session["rcbRegionValue"] != null)  
            {  
                Session.Remove("rcbRegionValue");  
            }  
        }  
 
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                Master.HeaderImagePath = "~/Images/user.gif";  
                Master.HeaderText = "Site Management";  
            }  
            TIPWebITLibrary.BLL.UserManagement.User oUser = null;  
            oUser = this.Master.SessionUser;  
            if (oUser.UserRoleUID == 2)  
            {  
                ((GridEditCommandColumn)RadGridSites.MasterTableView.Columns.FindByUniqueName("EditCommandColumn")).EditImageUrl = "~/App_Themes/" + Page.Theme + "/Grid/Edit.gif";  
            }  
            else  
            {  
                ((GridEditCommandColumn)RadGridSites.MasterTableView.Columns.FindByUniqueName("EditCommandColumn")).Visible = false;  
            }  
 
            RadProgressArea1.Localization.Uploaded = "Total Progress";  
            RadProgressArea1.Localization.UploadedFiles = "Progress";  
            RadProgressArea1.Localization.CurrentFileName = "Custom progress in action: ";  
 
        }  
 
        protected void RadGridSites_ItemCreated(object sender, GridItemEventArgs e)  
        {  
 
 
            if (e.Item is GridCommandItem)  
            {  
                TIPWebITLibrary.BLL.UserManagement.User oUser = null;  
                oUser = this.Master.SessionUser;  
                if (oUser.UserRoleUID == 2)  
                {  
                    ((ImageButton)e.Item.FindControl("ImageButtonAddRecord")).ImageUrl = "~/App_Themes/" + Page.Theme + "/Grid/AddRecord.gif";  
                }  
                else  
                {  
                    ((ImageButton)e.Item.FindControl("ImageButtonAddRecord")).Visible = false;  
                    ((LinkButton)e.Item.FindControl("LinkButtonAddRecord")).Visible = false;  
                }  
                ((ImageButton)e.Item.FindControl("ImageButtonRefresh")).ImageUrl = "~/App_Themes/" + Page.Theme + "/Grid/Refresh.gif";  
                if (this.HiddenFieldShowInactive.Value == "True")  
                {  
                    ((CheckBox)e.Item.FindControl("CheckShowInactive")).Checked = true;  
                }  
            }  
 
 
            //RadProgressContext context = RadProgressContext.Current;  
            //if (e.Item.ItemIndex > 0)  
            //{  
            //    context.PrimaryPercent = e.Item.ItemIndex.ToString();  
 
            //    context.SecondaryValue = e.Item.ItemIndex.ToString();  
            //    context.CurrentOperationText = "Creating items...";  
 
 
            //}  
        }  
 
        protected void RadGridSites_ItemCommand(object source, GridCommandEventArgs e)  
        {  
            if (ViewState["CheckStatus"] != null)  
            {  
                if (Convert.ToBoolean(ViewState["CheckStatus"], CultureInfo.InvariantCulture))  
                {  
                    this.HiddenFieldShowInactive.Value = "True";  
                }  
                else  
                {  
                    this.HiddenFieldShowInactive.Value = "False";  
                }  
            }  
            GridDataItem selectedItem = null;  
            switch (e.CommandName)  
            {  
                case "Update":  
                case "PerformInsert":  
                    e.Canceled = true;  
                    break;  
                case "RebindGrid":  
                    this.RadGridSites.MasterTableView.FilterExpression = string.Empty;  
 
                    foreach (GridColumn column in RadGridSites.MasterTableView.Columns)  
                    {  
                        column.CurrentFilterValue = string.Empty;  
                        Session.Remove("rcbRegionValue");  
                    }  
                    foreach (GridDataItem item in this.RadGridSites.Items)  
                    {  
                        item.Expanded = false;  
                    }  
                    this.RadGridSites.MasterTableView.ClearEditItems();  
                    break;  
                case "Edit":  
                    this.RadGridSites.MasterTableView.IsItemInserted = false;  
                    break;  
                case "InitInsert":  
                    this.RadGridSites.MasterTableView.ClearEditItems();  
                    break;  
                case "Filter":  
                    foreach (GridDataItem item in this.RadGridSites.Items)  
                    {  
                        item.Expanded = false;  
                    }  
                    this.RadGridSites.MasterTableView.ClearEditItems();  
                    break;  
                case "ExpandCollapse":  
                    selectedItem = (GridDataItem)e.Item;  
                    if (selectedItem.Expanded)  
                    {  
                        //Collapsing  
                        selectedItem.Selected = false;  
                    }  
                    else  
                    {  
                        //Expanding  
                        foreach (GridDataItem item in this.RadGridSites.Items)  
                        {  
                            item.Expanded = false;  
                        }  
                        this.RadGridSites.MasterTableView.ClearEditItems();  
                        this.RadGridSites.MasterTableView.ClearSelectedItems();  
                        selectedItem.Selected = true;  
                    }  
                    break;  
                case "RowClick":  
                    selectedItem = (GridDataItem)e.Item;  
                    if (selectedItem.Expanded)  
                    {  
                        selectedItem.Selected = false;  
                        selectedItem.Expanded = false;  
                    }  
                    else  
                    {  
                        foreach (GridDataItem item in this.RadGridSites.Items)  
                        {  
                            item.Expanded = false;  
                        }  
                        this.RadGridSites.MasterTableView.ClearEditItems();  
                        this.RadGridSites.MasterTableView.ClearSelectedItems();  
                        selectedItem.Selected = true;  
                        selectedItem.Expanded = true;  
                    }  
                    break;  
            }  
        }  
 
        protected void CheckShowInactive_CheckedChanged(object sender, EventArgs e)  
        {  
            CheckBox checkStatus;  
            LinkButton linkButtonSender = sender as LinkButton;  
            if (linkButtonSender != null)  
            {  
                checkStatus = (CheckBox)linkButtonSender.Parent.FindControl("CheckShowInactive");  
                if (checkStatus.Checked)  
                {  
                    checkStatus.Checked = false;  
                }  
                else  
                {  
                    checkStatus.Checked = true;  
                }  
            }  
            else  
            {  
                checkStatus = (CheckBox)sender;  
            }  
            if (checkStatus.Checked)  
            {  
                ViewState["CheckStatus"] = "true";  
                this.HiddenFieldShowInactive.Value = "True";  
            }  
            else  
            {  
                ViewState["CheckStatus"] = "false";  
                this.HiddenFieldShowInactive.Value = "False";  
            }  
            RadGridSites.MasterTableView.ClearEditItems();  
        }  
 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            if (e.Argument == "RadWindowSiteType")  
            {  
                if (RadGridSites.MasterTableView.IsItemInserted == true)  
                {  
                    SiteDetails mySiteDetails = (SiteDetails)RadGridSites.MasterTableView.GetInsertItem().FindControl(GridEditFormItem.EditFormUserControlID);  
                    if (e.Argument == "RadWindowSiteType")  
                    {  
                        RadComboBox ddlSiteTypes = (RadComboBox)mySiteDetails.FindControl("SiteTypeUIDDropDownList");  
                        ddlSiteTypes.Items.Clear();  
                        ddlSiteTypes.Items.Add(new RadComboBoxItem("", ""));  
                        ddlSiteTypes.DataBind();  
                    }  
                }  
                else  
                {  
                    RadGridSites.MasterTableView.Rebind();  
                }  
            }  
        }  
 
        protected void RadGridSites_PreRender(object sender, EventArgs e)  
        {  
            if (ViewState["CheckStatus"] != null)  
            {  
                GridItem commandItem = RadGridSites.MasterTableView.GetItems(GridItemType.CommandItem)[0];  
                CheckBox checkBox = (CheckBox)commandItem.FindControl("CheckShowInactive");  
                if (ViewState["CheckStatus"].ToString() == "true")  
                {  
                    checkBox.Checked = true;  
                    this.HiddenFieldShowInactive.Value = "True";  
                }  
                else  
                {  
                    checkBox.Checked = false;  
                    this.HiddenFieldShowInactive.Value = "False";  
                }  
            }  
            ((GridTemplateColumn)this.RadGridSites.MasterTableView.Columns.FindByUniqueName("SiteID")).CurrentFilterFunction = GridKnownFunction.StartsWith;  
            ((GridTemplateColumn)this.RadGridSites.MasterTableView.Columns.FindByUniqueName("Contact")).CurrentFilterFunction = GridKnownFunction.StartsWith;  
        }  
 
        protected void RadGridSites_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridPagerItem)  
            {  
                RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");  
                PageSizeCombo.Items.Clear();  
                PageSizeCombo.Items.Add(new RadComboBoxItem("20"));  
                PageSizeCombo.FindItemByText("20").Attributes.Add("ownerTableViewId", RadGridSites.MasterTableView.ClientID);  
                PageSizeCombo.Items.Add(new RadComboBoxItem("50"));  
                PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", RadGridSites.MasterTableView.ClientID);  
                PageSizeCombo.Items.Add(new RadComboBoxItem("100"));  
                PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", RadGridSites.MasterTableView.ClientID);  
                PageSizeCombo.Items.Add(new RadComboBoxItem("250"));  
                PageSizeCombo.FindItemByText("250").Attributes.Add("ownerTableViewId", RadGridSites.MasterTableView.ClientID);  
                PageSizeCombo.Items.Add(new RadComboBoxItem("300"));  
                PageSizeCombo.FindItemByText("300").Attributes.Add("ownerTableViewId", RadGridSites.MasterTableView.ClientID);  
                PageSizeCombo.FindItemByText(e.Item.OwnerTableView.PageSize.ToString(CultureInfo.InvariantCulture)).Selected = true;  
            }  
 
            //RadProgressContext context = RadProgressContext.Current;  
            //if (e.Item.ItemIndex > 0)  
            //{  
            //    context.SecondaryValue = e.Item.ItemIndex.ToString();  
            //    context.CurrentOperationText = "Creating items...";  
            //}  
        }  
 
        protected void ExportClick(object sender, EventArgs e)  
        {  
            this.RadGridSites.ExportSettings.OpenInNewWindow = true;  
            this.RadGridSites.ExportSettings.ExportOnlyData = true;  
            this.RadGridSites.ExportSettings.IgnorePaging = true;  
            UpdateProgressContext();  
 
            this.RadGridSites.MasterTableView.ExportToExcel();  
            this.RadProgressArea1.Visible = false;  
 
 
        }  
        //protected override void OnPreRenderComplete(EventArgs e)  
        //{  
        //    //http://www.telerik.com/community/forums/aspnet-ajax/grid/display-loading-panel-during-export.aspx  
        //    //http://demos.telerik.com/aspnet-ajax/upload/examples/customprogress/defaultcs.aspx?RadUrid=17ff8ea5-9104-4925-9c26-54b91de34242  
        //    //if (this.RadGridSites.MasterTableView.Items.Count > 100)  
        //    //{  
        //    RadProgressContext context = RadProgressContext.Current;  
        //    context.CurrentOperationText = "Sending to client...";  
        //    context["ProgressDone"] = true;  
        //    context.OperationComplete = true;  
 
        //    base.OnPreRenderComplete(e);  
        //    //}  
 
 
 
        //}  
 
        private void UpdateProgressContext()  
        {  
            const int total = 100;  
 
            RadProgressContext progress = RadProgressContext.Current;  
            progress.Speed = "N/A";  
 
            for (int i = 0; i < total; i++)  
            {  
                progress.PrimaryTotal = 1;  
                progress.PrimaryValue = 1;  
                progress.PrimaryPercent = 100;  
 
                progress.SecondaryTotal = total;  
                progress.SecondaryValue = i;  
                progress.SecondaryPercent = i;  
 
                progress.CurrentOperationText = "Step " + i.ToString();  
 
                if (!Response.IsClientConnected)  
                {  
                    //Cancel button was clicked or the browser was closed, so stop processing  
                    break;  
                }  
 
                progress.TimeEstimated = (total - i) * 100;  
                //Stall the current thread for 0.1 seconds  
                System.Threading.Thread.Sleep(100);  
            }  
        }  
 
    }  
}  
 
Genady Sergeev
Telerik team
 answered on 03 Jan 2011
0 answers
82 views
Hi, 
I have some questions regarding toolbar in MOSSradEditor.
1. When the MOSSRadEditor is the only control on the page, or for any other reason has the focus as soon as it is loaded the toolbar is always shown, even when the editor is set to have only the preview mode:

editorPreview.EditModes = EditModes.Preview;

Adding the following client-side script doesn't help either:

    <script type="text/javascript" language="javascript">
        function Editor_ClientLoad(editor, args) {
            editor.set_mode(4);
            editor.set_editable(false);
            editor.enableEditing(false);
        }
   </script>

What is your suggestion to solve this issue?

2. I would like to make some toolbar buttons invisible as soon as the editor is selected, hence the toolbar is shown. I use the following client side code:
        function Editor_ClientLoad(editor, args) {
            editor.attachEventHandler("onmousedown", function(e) {
        var oTool = this.Editor.getToolByName("buttonName"); //get a reference to the custom tool
        if (oTool == null)
            return;
        oTool.set_visible(false); 
            });
}
After the first mouse click, toolbar buttons are not yet accessible, in other words oTool==null. After the second click it works fine.
How can I solve this problem, Can you suggest a better way to get the same results?

3. If there are two or more toolbars defined for a single editor, how can we get a reference to the toolbar causing the client side event "OnClientCommandExecuting" in the corresponding evand handler?

I appreciate your reponse.
Regards,
Ali.
Ali
Top achievements
Rank 1
 asked on 03 Jan 2011
1 answer
74 views
Hello,

I tried everything, but the Grid does not show a Link to Insert a new item.
I got a SqlDataSource with automatic generated Select, Insert, Delete and Update statements.
With the Grid i can do Update and Delete without any probs, but it does not show the Insert link.

Somebody knows what i have to change manually to show the Insert Link?
This is the code of the Grid "gvUser"

    <telerik:RadGrid ID="gvUser" runat="server" AllowSorting="True" AutoGenerateColumns="False"
        AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" DataSourceID="srcGv"
        GridLines="None" Skin="Windows7" onitemcreated="gvUser_ItemCreated"
        AllowPaging="True" onupdatecommand="gvUser_UpdateCommand" AllowAutomaticInserts="true">
        <MasterTableView DataSourceID="srcGv" EditMode="InPlace" ClientDataKeyNames="pk" DataKeyNames="pk" PageSize="10" InsertItemDisplay="Top" AllowAutomaticInserts="true">
            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
... Colums ...
            </Columns>
            <EditFormSettings InsertCaption="Neuer Benutzer">
                <EditColumn FilterControlAltText="Filter EditCommandColumn column" UpdateText="Anwenden" InsertText="Hinzufügen" CancelText="Abbrechen">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>
    </telerik:RadGrid>

and this is the SqlDataSource

    <asp:SqlDataSource ID="srcGv" runat="server" ConnectionString="<%$ ConnectionStrings:cn%>"
        DeleteCommand= ... here is the Delete Command
        InsertCommand= ... here is the Insert Command ....
        SelectCommand= ... here is the Select Command ...
        UpdateCommand=... here is the Update Command ...
        <DeleteParameters>
... Delete Param ...
        </DeleteParameters>
        <InsertParameters>
... Insert Params ....
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="cboR" Name="R" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
... Update Params ...
        </UpdateParameters>
    </asp:SqlDataSource>
Raimund
Top achievements
Rank 1
 answered on 03 Jan 2011
3 answers
114 views
Hello is it possible to change the name of tabs "Day", "Week" and "Mounth"  in the radscheduler?
Veronica
Telerik team
 answered on 03 Jan 2011
1 answer
60 views
We have a page with a RadUpload (an instance of our own descendant of RadUpload).  Someone has reported that it is choking on a 50 megabyte file.  I have been tasked to investigate this.  It appears that we have a RadUpload in a user control with Localization.Select =Browse.  There does not appear to be any RadProgressManager or RadProgressArea.

According to "http://www.telerik.com/products/aspnet-ajax/upload.aspx":

"The Telerik ASP.NET Upload control now features a new HttpHandler specially designed for monitoring the process and updating its progress. As a result upon a request for progress update the server is not hit as the page does not go through the complete page lifecycle as this is not needed. This significantly reduces the server load and data transfer. "

How do I determine if this HttpHandler is being used?
Genady Sergeev
Telerik team
 answered on 03 Jan 2011
8 answers
315 views
Hello,

I have a problem with displaying a specific website (www.oritajewellery.com) using the radwindow. All other websites are displayed well.

Please open the following web page in order to view the problem: http://www.israel-jewelry-center.com/Pages/Categories/Rings.aspx.
By hovering over the image which is displayed in the attached image (1.jpg), a radtooltip will be displayed, and then click the displayed big image in order to view the website in a radwindow control. Here is the problem, the above website is not displayed (view attached image 2.jpg).

My code:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">   
        <Windows>   
            <telerik:RadWindow runat="server" Width="600px" Height="550px" VisibleStatusbar="false" style="z-index:10000;"
                ID="ExplorerWindow" Modal="true" Behaviors="Default">
            </telerik:RadWindow>
        </Windows>   
    </telerik:RadWindowManager>

I want to indicate again that just the above website is not displayed using the radwindow control.

Regards,
Bader
Georgi Tunev
Telerik team
 answered on 03 Jan 2011
1 answer
100 views
I have a RadListView inside an item template of RadPanelBar, the RadPanelBar is being managed by the ajaxmanager. I can successfully rebind the listview but new items don't display until a full postback.

How can I rebind the listview and have the items display without a full postback  when cannot reference the nested control directly in the ajaxmanager settings?

Shinu
Top achievements
Rank 2
 answered on 03 Jan 2011
0 answers
49 views
Hello Team,

I am using Rad Upload control and Rad Progress area for file upload functionality.I need to perform a custom functionally when i cancel the uploading of the files. From the telerik forums, i found that OnClientProgressUpdating event cant be used. My custom functionality exist in the corresponding cs file of the page where my Rad Upload controls are present.I want to know how can i get the cancel event of the cancel button click. If OnClientProgressUpdating is the method to achieve it, i found that it is invoked each time when the progress updates. I need to invoke it only when the cancel button is clicked. Also how can i call my custom function present in the cs code frm the javascript function OnClientProgressUpdating(). Please let me  know how can i achieve the same. How can i invoke a custom functionality in the cancel button of the RadProgressArea.

Thanks,
Divya

Divya
Top achievements
Rank 1
 asked on 03 Jan 2011
1 answer
45 views
I want to implement this functionality:
  1. Select multiple rows in radgrid.
  2. Click in a command item.
  3. Show a popup window to let the user enter additional common data.
  4. Make the post with selected rows and additional common data.
  5. In the server, process selected rows with additional common data.
Thanks in advance
Jaume Aguiló
Pavlina
Telerik team
 answered on 03 Jan 2011
7 answers
148 views
Thanks Telerik team for replying on my previous thread. Somehow I lost it so opening a new one. Thanks for sending me the exact solution to my problem. I have started working towards the example you send me. http://www.telerik.com/help/aspnet-ajax/grdcustomoptionforfiltering.html 

It's throwing an error "Object reference not set to an instance of an object." on "string[] values = tbPattern.Text.Split(' ');". Don't know why ??

if (e.CommandName == RadGrid.FilterCommandName)
            {
                Pair filterPair = (Pair)e.CommandArgument;
                if (filterPair.Second.ToString() == "DateCreated")
                {
                    string colName = filterPair.Second.ToString();
                    TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
                    string[] values = tbPattern.Text.Split(' ');
                    if (values.Length == 2)
                    {
                        e.Canceled = true;
                        string newFilter = "(([" + filterPair.Second + "] >='" + values[0] + "') AND ([" + filterPair.Second + "] <='" + values[1] + "'))";
                        if (taskGrid.MasterTableView.FilterExpression == "")
                        {
                            taskGrid.MasterTableView.FilterExpression = "('" + startDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "' <= [DateCreated] AND [DateCreated] <= '" + endDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "')" + newFilter;
                        }
                        else
                        {
                            taskGrid.MasterTableView.FilterExpression += " AND ('" + startDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "' <= [DateCreated] AND [DateCreated] <= '" + endDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "'  )";
                        }
  
                    }
                }
  
            }
Please help
Marin
Telerik team
 answered on 03 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?