Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
Hello,

I have been working on Radscheduler for sometime  and we have a requirement, in radscheduler if we  create tasks  they will be shown in Rectangular boxes Extending upto howmany days/hours that task is assigned our requirement is to replace the Hyperlinks in place of rectangular boxes ,if the task is assigned to day or two show the same task for two days individually instead of continuing the rectangular box  can we do that in telerik ,i am sending a screen shot of tasks  in scheduler according to requirement what we need (if we click on tasks the hyperlink will appear in actual website)  Please respond if u  know how to do it in telerik.

Regrds,
Madhukar.
Peter
Telerik team
 answered on 30 Jan 2012
1 answer
25 views
Hi
In Month view, how to make the week´s number display at the left side of each row?
Ivana
Telerik team
 answered on 30 Jan 2012
4 answers
245 views
Hi,

How can I add styles for appointment mouse hover and appointment select. I tried various custom skins, but I do not find any style applied on appointments for these events. Please suggest.

Ivana
Telerik team
 answered on 30 Jan 2012
3 answers
108 views
I have a page with a radscheduler.  I noticed today that I am getting this error on the page:

An entry with the same key already exists.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: An entry with the same key already exists.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[ArgumentException: An entry with the same key already exists.]
   System.Collections.Specialized.ListDictionary.Add(Object key, Object value) +6232061
   System.Web.UI.ClientScriptManager.RegisterExpandoAttribute(String controlId, String attributeName, String attributeValue, Boolean encode) +272
   System.Web.UI.ScriptRegistrationManager.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +115
   System.Web.UI.ScriptManager.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +44

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +251
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +2377
   System.Web.UI.WebControls.ValidatorCompatibilityHelper.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +170
   System.Web.UI.WebControls.BaseValidator.AddAttributesToRender(HtmlTextWriter writer) +330
   System.Web.UI.WebControls.RequiredFieldValidator.AddAttributesToRender(HtmlTextWriter writer) +18
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
   System.Web.UI.WebControls.BaseValidator.Render(HtmlTextWriter writer) +445
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   Telerik.Web.UI.SchedulerFormContainer.Render(HtmlTextWriter writer) +424
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   Telerik.Web.UI.RadDataBoundControl.RenderContents(HtmlTextWriter writer) +50
   Telerik.Web.UI.RadScheduler.RenderContents(HtmlTextWriter writer) +48
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +92
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +173
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060

This error seems to be connected to the webservicesettings element.  If I remove that element, the page loads, but when I include, it fails.  

<telerik:RadScheduler runat="server" ID="rsEvents" StartEditingInAdvancedForm="true"
            StartInsertingInAdvancedForm="true" OnClientAppointmentContextMenuItemClicked="appointmentContextMenuItemClicked"
            ShowAllDayRow="true" Width="585px" Height="675px" SelectedView="MonthView" ShowFooter="true"
            DayStartTime="07:00:00" DayEndTime="20:00:00" FirstDayOfWeek="Sunday" LastDayOfWeek="Saturday"
            EnableDescriptionField="true" OnClientAppointmentDoubleClick="onAppointmentDoubleClick"
            OnClientAppointmentsPopulating="onAppointmentsPopulating">
            <WebServiceSettings Path="~/Scheduler.asmx" ResourcePopulationMode="ServerSide" />
            <TimelineView GroupBy="Calendar" GroupingDirection="Vertical" UserSelectable="false" />
            <AdvancedForm Modal="true" />
            <ResourceTypes>
                <telerik:ResourceType Name="Category" TextField="Description" KeyField="Id" />
            </ResourceTypes>
            <AppointmentTemplate>
                <div class="rsAptSubject">
                    <%# Eval("Subject") %>
                </div>
                <%# Eval("Description") %>
            </AppointmentTemplate>
        </telerik:RadScheduler>
Ivana
Telerik team
 answered on 30 Jan 2012
3 answers
152 views
I have simple editor on my page. This editor contains align buttons toolbar (center, right, justify).
I've set newline mode to paragraphs which I can see in html editor. I have set CSSFiles for editor set to empty css. I have option StripFormattingOptions="NoneSupressCleanMessage" to prevent firefox crash with big copy paste.

My problem is that align buttons not working, pressing them do not change anything. They look like cannot be pressed. Nothing is happening during pressing. On html preview nothing is changing.

What am I missing?

PS.
1. I'm working under firefox 7
2. I notice that clicking allign buttons is changing aligment of font toolbar, font comboboxes. I notice the same issue on demo. Sometimes when clicking alignemnt buttons it is changing aligmnet of source code below not one in editor.
Rumen
Telerik team
 answered on 30 Jan 2012
2 answers
536 views
We've been experiencing a JavaScript problem with the RadControls for the past few days: 
Error: "Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.
Parameter Name: instance

Symptoms: The problem intermittently switches between IE6 and most other browsers. For example, if we rebuild the solution and hit the page with IE6 we don't see the exception, but if we then go to Firefox we'll see those exceptions in Firebug. If we then rebuild again and hit the page with Firefox first, it will be fine, but then IE6 starts reporting these errors. In non-IE6 browsers the error won't occur then. 

System information:
Asp.net version = 4.0
Telerik version = 2011.3.1115.40
IIS 7.5 

Solutions we had tried
1. Disabled smart navigation in the web.config file
2. Set the script mode of the script manager to release
3. Set debug = false in the web.config
None of which solved the problem...

Solution
We did discover in the end that in the RadWindow that was being shown had a button on it with its RegisterWithScriptManager set to false. When this is set to true the problem disappeared. 

Question That Still Remain
When we were initially trying to isolate the problem we had commented out the JavaScript code that launched the modal window, meaning the window wasn't being shown at all and yet the exception was still raised. The javascript code we did use was window.setUrl and window.show, so we commented out the line that called the show method. Why would this error then still come up? Is it possible that the setUrl method instantiates the window in the background without calling show()? 

Hope this saves someone else the countless days it took us to figure out where the problem was coming from. 

Regards,
Jacques

Jacques
Top achievements
Rank 2
 answered on 30 Jan 2012
1 answer
37 views
I've come across a problem with the related comboboxes. If you place your cursor in the first combobox and click backspace the browser will take you back a page. I've testing this with the demo app, http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx on the telerik site and on my own apps. Happens with Chrome and IE 9, haven't tried it on anyother browsers.

Is this a bug or is there a setting I can use to prevent this behavior.

Thanks.
Dimitar Terziev
Telerik team
 answered on 30 Jan 2012
1 answer
113 views
I am using the built-in filtering on a RadGrid but I'm running into a problem with one column in particular. When I try to filter on the column in question, I get an "Object reference not set to an instance of an object" error and the filtering doesn't work. This particular column is generated from a subquery that's being used as a column expression (and then given an alias). It seems like the filtering only works for grid columns that have a matching column name in a database table (i.e. doesn't seem to work with columns generated from a subquery or UDF). Here is my aspx markup:
<telerik:RadGrid ID="grdAdmin" runat="server" Width="100%" AllowFilteringByColumn="True"
    GridLines="None" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" onneeddatasource="grdAdmin_NeedDataSource"
    PageSize="20"
    ondeletecommand="grdAdmin_DeleteCommand">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView DataKeyNames="NominationID" NoMasterRecordsText="There are currently no nominations to display."
    Width="100%" CommandItemDisplay="Top" AutoGenerateColumns="False">
        <Columns
            <telerik:GridDateTimeColumn DataField="DateOfNomination" DataFormatString="{0:d}" HeaderText="Date Of Nomination" SortExpression="DateOfNomination" UniqueName="DateOfNomination" ReadOnly="true">
            </telerik:GridDateTimeColumn>       
            <telerik:GridBoundColumn DataField="NomineeName" HeaderText="Nominee Name"
                SortExpression="NomineeName" DataType="System.String" UniqueName="NomineeName" ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="NominatorName" HeaderText="Nominator Name"
                SortExpression="NominatorName" DataType="System.String" UniqueName="NominatorName" ReadOnly="true" AllowFiltering="false">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteCommandColumn" ConfirmDialogType="Classic" ConfirmText="Are you sure you want to delete this nomination from the database?" ConfirmTitle="Are you sure?">  
            </telerik:GridButtonColumn
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

The column that I get the error on is the NomineeName column. Here is the C# codebehind:

protected void grdAdmin_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    using (RecognitionEntities dc = new RecognitionEntities())
    {
        string selectStatement = string.Format(@"select n.NominationID,
            n.DateOfNomination,
            (SELECT FULL_NAME FROM dwdata.person_table where PERSON_ID=n.NomineeEmployeeID) as NomineeName,
            (SELECT FULL_NAME FROM dwdata.person_table where PERSON_ID=n.NominatorEmployeeID) as NominatorName
            from dbo.tblNominations as n
            where (n.DeletedBy IS NULL)
            and (n.FiscalYear = '{0}')",
                                               ConfigurationManager.AppSettings["CurrentFiscalYear"]);
 
        // bind the results to the grid
        IEnumerable<NominationAdmin> pn = dc.ExecuteStoreQuery<NominationAdmin>(selectStatement);
        grdAdmin.DataSource = pn.ToList();
    }
}

And here is the NominationAdmin.cs file:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Recognition.EntityDataModel
{
    public class NominationAdmin
    {
        private int _nominationID;
        private DateTime _dateOfNomination;
        private string _nomineeName;
        private string _nominatorName;
 
        public int NominationID
        {
            get { return this._nominationID; }
            set { this._nominationID = value; }
        }
 
        public DateTime DateOfNomination
        {
            get { return this._dateOfNomination; }
            set { this._dateOfNomination = value; }
        }
 
        public string NomineeName
        {
            get { return this._nomineeName; }
            set { this._nomineeName = value; }
        }
 
        public string NominatorName
        {
            get { return this._nominatorName; }
            set { this._nominatorName = value; }
        }
    }
}

Any idea what's going on and how to fix it? Thanks.
Mira
Telerik team
 answered on 30 Jan 2012
1 answer
146 views
Hi,

We are trying to achieve the following goal: Invoke a RAD Progress Bar (located in a master page) from a child content-area page *while at the same time* disabling all of the screen content in the pnlMainZoneId control in the master page (IE: showing the ajax hourglass) except for the progress bar & its cancel button. When either the progress bar is complete or the cancel button is clicked, we want the ajax hourglass to go away and all of the screen controls to be re-enabled.

I have been trying to implement the following article: http://www.telerik.com/help/aspnet-ajax/ajax-masterpage-update-everywhere.html

...however, I am getting an exception "object not set to an instance..." when reaching this line: ajaxMgr.AjaxSettings.AddAjaxSetting(object1, object2);

Could someone please give me a bit of direction? I have confirmed that the ajaxMgr, object1 and object2 are all correctly instantiated and populated, so I'm not sure where the error is coming from.

I have attached a sample of the pages we are using to replicate the error, below. Please let me know if I can provide more information. Thank you!

Lars


[TEST.MASTER]

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="test.master.cs" Inherits="AutoAAP.test1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<html>
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form2" runat="server" style="height: 100%;">
        
            <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
            <script type="text/javascript">                     
                function handleProgressBarUpdateFromServer(sender, args)
                {
                    if ((args.get_progressData() && args.get_progressData().OperationComplete == 'true'))
                    {
                        args.set_cancel(true);                       
                    }
                }                                        
            </script>
            </telerik:RadScriptBlock>

            <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManagerMain">
                        <UpdatedControls><telerik:AjaxUpdatedControl ControlID="pnlMainZoneId" LoadingPanelID="RadAjaxLoadingPanelMain" /></UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelMain" runat="server" />
            <telerik:RadScriptManager ID="ScriptManager" runat="server" EnableTheming="True" ></telerik:RadScriptManager>

            <asp:Panel ID="divUniversalProgressBar" runat="server">        
                <telerik:RadProgressManager id="MasterRadProgressManager1" runat="server" />
                <telerik:RadProgressArea RegisterWithScriptManager="true" id="MasterRadProgressArea1" runat="server" DisplayCancelButton="true" OnClientProgressUpdating="handleProgressBarUpdateFromServer" />        
            </asp:Panel>

            <asp:Panel ID="pnlMainZoneId" runat="server" Height="100%" Width="100%" >            
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
            </asp:Panel>

       </form>
    </body>
</html>



[TEST.MASTER.CS]

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Global;
using AutoAAP.StateManagement;
using System.Collections.Generic;
using Telerik.Web.UI;
using Telerik.Web.UI.Upload;

namespace AutoAAP
{
    public partial class test1 : System.Web.UI.MasterPage
    {



        #region Page Events

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #endregion



        #region Progress bar subsystem.
    
        public struct ProgressBarConfig
        {
            public string dialogHeaderText;
            public string cancelText;
            public string elapsedTimeText;
            public string estimatedTimeText;
            public string totalText;
            public string totalFilesText;
            public string transferSpeedText;
            public string uploadedFilesText;
            public bool showProgressBar;
        }
        static public ProgressBarConfig ProgressBarConfiguration = new ProgressBarConfig();

        private void pbPause()
        {
            // Server wait 4 seconds after sending an update.
            // Since browser checks for progress every 3 seconds, should always receive updates.
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 4));
        }
        private bool pbIsNullOrEmptyString(string sArg)
        {
            bool ret = false;

            if (sArg == null)
            {
                ret = true;
            }
            else if (sArg == string.Empty)
            {
                ret = true;
            }
            else
            {
            }

            return ret;
        }

        /// <summary>
        /// Pass in NULL for strings if you want to hide those fields.
        /// </summary>
        public void ProgressBarConfigure(
        string dialogHeaderText, string cancelText, string elapsedTimeText, string estimatedTimeText,
        string totalText, string totalFilesText, string transferSpeedText, bool showProgressBar)
        {
            ProgressBarConfiguration                            = new ProgressBarConfig();
            ProgressBarConfiguration.dialogHeaderText           = dialogHeaderText;
            ProgressBarConfiguration.cancelText                 = cancelText;
            ProgressBarConfiguration.elapsedTimeText            = elapsedTimeText;
            ProgressBarConfiguration.estimatedTimeText          = estimatedTimeText;
            ProgressBarConfiguration.totalText                  = totalText;
            ProgressBarConfiguration.totalFilesText             = totalFilesText;
            ProgressBarConfiguration.transferSpeedText          = transferSpeedText;
            ProgressBarConfiguration.uploadedFilesText          = "?2Please wait... ";
            ProgressBarConfiguration.showProgressBar            = showProgressBar;

            ProgressBarReset();
        }
        public void ProgressBarReset()
        {
            MasterRadProgressArea1.HeaderText                       = ProgressBarConfiguration.dialogHeaderText;

            ProgressIndicators indicators                           = ProgressIndicators.None;

            MasterRadProgressArea1.Localization.Cancel              = ProgressBarConfiguration.cancelText;
            MasterRadProgressArea1.DisplayCancelButton              = !(pbIsNullOrEmptyString(ProgressBarConfiguration.cancelText));

            MasterRadProgressArea1.Localization.CurrentFileName = "";
            indicators |= ProgressIndicators.CurrentFileName;

            MasterRadProgressArea1.Localization.ElapsedTime         = ProgressBarConfiguration.elapsedTimeText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.elapsedTimeText))
                indicators |= ProgressIndicators.TimeElapsed;

            MasterRadProgressArea1.Localization.EstimatedTime       = ProgressBarConfiguration.estimatedTimeText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.estimatedTimeText))
                indicators |= ProgressIndicators.TimeEstimated;

            MasterRadProgressArea1.Localization.Total               = ProgressBarConfiguration.totalText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.totalText))
                indicators |= ProgressIndicators.TotalProgress;

            MasterRadProgressArea1.Localization.TotalFiles          = ProgressBarConfiguration.totalFilesText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.totalFilesText))
            {
                indicators |= ProgressIndicators.FilesCount;
                indicators |= ProgressIndicators.SelectedFilesCount;
                indicators |= ProgressIndicators.FilesCountBar;
                indicators |= ProgressIndicators.FilesCountPercent;
            }

            MasterRadProgressArea1.Localization.TransferSpeed       = ProgressBarConfiguration.transferSpeedText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.transferSpeedText))
                indicators |= ProgressIndicators.TransferSpeed;

            MasterRadProgressArea1.Localization.Uploaded            = "Please wait...";
            MasterRadProgressArea1.Localization.UploadedFiles       = ProgressBarConfiguration.uploadedFilesText;
                       
            if (ProgressBarConfiguration.showProgressBar)
            {
                indicators |= ProgressIndicators.TotalProgressBar;
                indicators |= ProgressIndicators.TotalProgressPercent;
            }
            
            MasterRadProgressArea1.ProgressIndicators               = indicators;
        }
        public void ProgressBarUpdate(string stepDescription, int stepNumber, int totalSteps)
        {
            // If someone does not pass in a description we
            // will do our best to create one for the end user.
            if (pbIsNullOrEmptyString(stepDescription))
            {
                stepDescription =
                    (stepNumber == 0)
                        ? "Initializing..."
                    : (stepNumber == totalSteps)
                        ? "Completing..."
                        : string.Format("Step {0} of {1}...", stepNumber, totalSteps);
            }

            // Can only update the RadProgressContext, the MasterRadProgressArea1
            // is NOT manipulatable after the ProgressBar appears in the UI. Must
            // cancel the ProgressBar first.
            RadProgressContext progress                             = RadProgressContext.Current;
            progress.OperationComplete                              = false;
            progress.CurrentOperationText                           = stepDescription;
          
            progress.PrimaryTotal                                   = stepNumber;
            progress.PrimaryValue                                   = totalSteps;
            progress.PrimaryPercent                                 = Math.Round(100m * ((totalSteps > 0) ? (stepNumber/(decimal)totalSteps) : 0), 0);

            if (stepNumber >= totalSteps)
            {
                progress.PrimaryTotal                               = totalSteps;
                progress.PrimaryValue                               = totalSteps;
                progress.PrimaryPercent                             = 100;

                pbPause(); // This 4 second pause gives the UI time to poll (every 3 seconds) for text / presentation changes.
                progress.OperationComplete                          = true;
            }
            else
            {
                progress.OperationComplete                          = false;
                pbPause(); // This 4 second pause gives the UI time to poll (every 3 seconds) for text / presentation changes.
            }
        }
        public void ProgressBarHideNow()
        {
            ProgressBarUpdate("Cancelled. Cleaning up...", 0, 0);
        }

    #endregion


   }
}



[TEST.ASPX]

<%@ Page Title="" Language="C#" MasterPageFile="~/test.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="AutoAAP.test" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <p>We are testing the invocation of the master page's progress dialog from a content page.</p>

   
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnBeginUpdates">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divUniversalProgressBar" LoadingPanelID="pnlMainZoneId" />
                    <telerik:AjaxUpdatedControl ControlID="MasterRadProgressManager1" LoadingPanelID="pnlMainZoneId" />
                    <telerik:AjaxUpdatedControl ControlID="MasterRadProgressArea1" LoadingPanelID="pnlMainZoneId" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>


    <asp:Panel ID="pnlButtons" runat="server">
        <asp:Button ID="btnBeginUpdates" runat="server" Text="Test Progress Bar" onclick="btnBeginUpdates_Click" />
    </asp:Panel>

</asp:Content>


[TEST.ASPX.CS]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Telerik.Web.UI.Upload;

namespace AutoAAP
{
    public partial class test : System.Web.UI.Page
    {

        static private int _curStep = 0;
        static private int _maxStep = 4;
        static private bool _cancelled = false;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                setupProgressBar(); // When this page is first rendered we need to call "resetProgressBar()" if we are going to use the progress bar on this page.


                RadAjaxManager ajaxMgr      = RadAjaxManager.GetCurrent(Page); //(RadAjaxManager)this.Master.FindControl("RadAjaxManagerMain");
                RadAjaxLoadingPanel pLoad   = (RadAjaxLoadingPanel)this.Master.FindControl("RadAjaxLoadingPanelMain"); //pnlMainZoneId                
                    
                Panel p1                                = (Panel)this.Master.FindControl("divUniversalProgressBar");
                RadProgressManager pRadProgressManager  = (RadProgressManager)this.Master.FindControl("MasterRadProgressManager1");
                RadProgressArea pRadProgressArea        = (RadProgressArea)this.Master.FindControl("MasterRadProgressArea1");


// These statements all throw errors, do not know why!

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, p1); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressManager); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressArea); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }


                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, p1, pLoad); }
                catch (Exception ex) {System.Diagnostics.Debug.Print(ex.Message); }

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressManager, pLoad); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message);}

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressArea, pLoad); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message);}



            }
        }


        private AutoAAP.test1 getMaster()
        {
            return ((AutoAAP.test1)this.Master);
        }

        private void setupProgressBar()
        {
            _curStep = 0;
            _cancelled = false;
            getMaster().ProgressBarConfigure(
                "Progress Bar Test",
                "Cancel",
                "Elapsed Time",
                null, //"3estimatedTime",
                "4total",
                null, //"totalFiles",
                null, //"transferSpeed",
                true
                );
        }

        protected void btnConfigure_Click(object sender, EventArgs e)
        {
            setupProgressBar();
        }

        protected void btnBeginUpdates_Click(object sender, EventArgs e)
        {
            _curStep = 0;
            getMaster().ProgressBarReset(); // It's wise to always do a reset.

            for (int i = 0; i <= _maxStep; i++)
            {
                if (Response.IsClientConnected & !_cancelled)
                {
                    getMaster().ProgressBarUpdate(
                        null,
                        _curStep,
                        _maxStep
                        );

                    _curStep++;
                }
                else
                {
                    // If Response.IsClientConnected == false,
                    // the user clicked Cancel or closed their browser.
                    _cancelled = false;
                    getMaster().ProgressBarReset();
                    break;
                }
            }
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            _cancelled = true;
            getMaster().ProgressBarHideNow();
            getMaster().ProgressBarReset();
        }

        protected void btnReset_Click(object sender, EventArgs e)
        {
            setupProgressBar();
        }


    }
}
Maria Ilieva
Telerik team
 answered on 30 Jan 2012
3 answers
211 views
Hi there,

I'm using the RadWindow 2011 Q3 and for some reason it sporadically throws javascript errors in internet explorer 6. Here is my code:

<telerik:RadAjaxManagerProxy ID="UserAjaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="UserListGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RefreshList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="DeleteSelectedItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Search">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>


<
telerik:RadWindowManager ID="RadWindows" runat="server" Skin="Web20" Behaviors="Close,Move,Resize">
        <Windows>
            <telerik:RadWindow Height="362" Width="504" ID="ViewWindow" OnClientClose="updateRadGrid" RegisterWithScriptManager="false" runat="server" CssClass="actionWindow" NavigateUrl="UserEditor.aspx" VisibleStatusbar="false" VisibleTitlebar="true" ReloadOnShow="true">
            </telerik:RadWindow>
        </Windows>
     </telerik:RadWindowManager>
 
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            //View USER
            function showUserViewerWindow(userId)
            {
                var actionWindow = $find("<%=ViewWindow.ClientID %>");
                actionWindow.setUrl("UserViewer.aspx?userId=" + userId);
                actionWindow.show();
            }
 
            //UPDATEGRID
            function updateRadGrid(sender, eventArgs)
            {
                var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
                ajaxManager.ajaxRequestWithTarget("<%= RefreshList.UniqueID%>");
            }
        </script>
     </telerik:RadCodeBlock>

I have attached alerts to the $find function and I keep getting a null value in IE6, a problem I'm not encountering in any other browsers. Ultimately, Im trying to resize the windows specifically for IE because Autosize ="true" always results in scrollbars. I have attached a screen capture of the script error I'm receiving.
Marin Bratanov
Telerik team
 answered on 30 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?