This is a migrated thread and some comments may be shown as answers.

Scheduler issue in IE 8

2 Answers 74 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Anto (DLL Version : 2008.3.1314.35) asked on 19 Aug 2010, 11:14 AM
Hi All

I have a scheduler in a page which works fine.

It works fine in IE 7.

But have a issue in IE 8

Have attached the screen shot of both IE 7 and IE 8

<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="AttendanceEmployeeView.aspx.cs"
    Inherits="Products.iSmart.AttendanceEmployeeView" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Attendance</title>
    <link href="../ImpetusBlue/Grid.ImpetusBlue.css" rel="stylesheet" type="text/css" />
    <link href="../ImpetusBlue/Menu.ImpetusBlue.css" rel="stylesheet" type="text/css" />
    <link href="../ImpetusBlue/Slider.ImpetusBlue.css" rel="stylesheet" type="text/css" />
    <telerik:RadScriptBlock ID="rsbk" runat="server">
  
        <script type="text/javascript">
            function SizeToFit() {
                window.setTimeout(
            function() {
                var oWnd = GetRadWindow();
                oWnd.SetWidth(650);
                oWnd.SetHeight(413);
                oWnd.moveTo(160, 100);
            }, 400);
            }
  
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
                return oWindow;
            }
              
              
            function setCalendarTable() {
  
                var picker = $find("<%= rdcDate.ClientID %>");
                var calendar = picker.get_calendar();
                var fastNavigation = calendar._getFastNavigation();
                $clearHandlers(picker.get_popupButton());
                picker.get_popupButton().href = "javascript:void(0);";
  
                $addHandler(picker.get_popupButton(), "click", function() {
  
                    var textbox = picker.get_textBox();
                    //adjust where to show the popup table 
                    var x, y;
                    var adjustElement = textbox;
                    if (textbox.style.display == "none")
                        adjustElement = picker.get_popupImage();
  
                    var pos = picker.getElementPosition(adjustElement);
                    x = pos.x;
                    y = pos.y + adjustElement.offsetHeight;
  
                    var e = {
                        clientX: x,
                        clientY: y - document.documentElement.scrollTop
                    };
                    //synchronize the input date if set with the picker one
                    var date = picker.get_selectedDate();
                    if (date) {
                        calendar.get_focusedDate()[0] = date.getFullYear();
                        calendar.get_focusedDate()[1] = date.getMonth() + 1;
                    }
  
                    $get(calendar._titleID).onclick(e);
  
                    return false;
                });
  
                fastNavigation.OnOK =
                    function() {
                        var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);
                        picker.get_dateInput().set_selectedDate(date);
                        fastNavigation.Popup.Hide();
                    }
  
  
                fastNavigation.OnToday =
                    function() {
                        var date = new Date();
                        picker.get_dateInput().set_selectedDate(date);
                        fastNavigation.Popup.Hide();
                    }
            }
              
              
              
  
        </script>
  
    </telerik:RadScriptBlock>
    <style type="text/css">
        .RadScheduler .rsAptContent, .RadScheduler .rsAptIn, .RadScheduler .rsAptMid, .RadScheduler .rsAptOut
        {
            background-image: none !important;
        }
    </style>
</head>
<body onload="SizeToFit()">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="smgr" runat="server">
    </asp:ScriptManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" IsSticky="true" Style="margin-top: 50px;
        margin-left: 300px; position: absolute; z-index: 100" Transparency="30" HorizontalAlign="Center"
        MinDisplayTime="500" BackColor="#E0E0E0">
        <asp:Image runat="server" ID="LoadingImage1" ImageUrl="~/iSmart/images/Loading.gif"
            AlternateText="Loading..." />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="LoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rdcDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rshdlrAttendance" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        Select Month  <telerik:RadDatePicker AutoPostBack="true" ID="rdcDate" Style="vertical-align: middle;"
            MinDate="1900-2-1" runat="server" Skin="Office2007" Calendar-EnableMonthYearFastNavigation="true">
            <DateInput ID="DateInput1" DateFormat="MMM-yyyy" runat="server">
            </DateInput>
        </telerik:RadDatePicker>
    </div>
    <br />
    <telerik:RadScheduler ShowNavigationPane="true" Height="300px" ShowHeader="false"
        ID="rshdlrAttendance" runat="server" DataKeyField="Day" DataStartField="DayStart"
        DataEndField="DayEnd" DataSubjectField="Att" AllowDelete="false" AllowEdit="false"
        AllowInsert="false" Skin="Web20" OnAppointmentDataBound="rshdlrAttendance_AppointmentDataBound"
        SelectedView="MonthView" ShowAllDayRow="false" CustomAttributeNames="Att">
        <TimelineView UserSelectable="false" />
        <MonthView MinimumRowHeight="1" />
        <MultiDayView ReadOnly="true" />
        <AppointmentTemplate>
            <div style="width: 100%; text-align: center; font-weight: bold;">
                <%# Eval("Att") %></div>
        </AppointmentTemplate>
    </telerik:RadScheduler>
      
    </form>
</body>
</html>

 

 

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 iSmart.BusinessLayer;
using Telerik.Web.UI;
  
namespace Products.iSmart
{
    public partial class AttendanceEmployeeView : System.Web.UI.Page
    {
        blEmployeeCTC BL = new blEmployeeCTC();
        String UserID;
        int Flag;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AuthenticatedUser"] == null)
                Response.Redirect("~/Admin/HomeCS.aspx");
            else
            {
                UserID = ((ProductAdmin.AuthenticatedUser)Session["AuthenticatedUser"]).UserID;
                //CompanyID = ((ProductAdmin.AuthenticatedUser)Session["AuthenticatedUser"]).CompanyID;
            }
            //UserID = "1359";
            rdcDate.MaxDate = DateTime.Now;
            if (!IsPostBack)
            {
                rdcDate.DatePopupButton.Attributes.Add("onclick", "setCalendarTable();return false;");
                rdcDate.SelectedDate = DateTime.Now;
            }
            if (rdcDate.SelectedDate < DateTime.Now)
                UDFShowAttendance();
        }
        protected void UDFShowAttendance()
        {
            //rshdlrAttendance.DataSource = BL.GetEmployeeAttendance(UserID, DateTime.Now.Month, DateTime.Now.Year, DateTime.Now.Day);
            if (Convert.ToDateTime(rdcDate.SelectedDate).Month == DateTime.Now.Month && Convert.ToDateTime(rdcDate.SelectedDate).Year == DateTime.Now.Year)
                Flag = 1;
            else
                Flag = 0;
            rshdlrAttendance.SelectedDate = Convert.ToDateTime(rdcDate.SelectedDate);
            rshdlrAttendance.DataSource = BL.GetEmployeeAttendance(UserID, Convert.ToDateTime(rdcDate.SelectedDate).Month, Convert.ToDateTime(rdcDate.SelectedDate).Year, DateTime.Now.Day,Flag);
            rshdlrAttendance.DataBind();
  
        }
  
        protected void rshdlrAttendance_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            e.Appointment.BackColor = System.Drawing.Color.White;
            e.Appointment.BorderColor = System.Drawing.Color.White;
            if (e.Appointment.Subject != null)
            {
                switch (e.Appointment.Subject)
                {
                    case "P":
                        e.Appointment.ForeColor = System.Drawing.Color.Green;
                        break;
                    case "A":
                        e.Appointment.ForeColor = System.Drawing.Color.Red;
                        break;
                    case "HPA":
                        e.Appointment.ForeColor = System.Drawing.Color.Purple;
                        break;
                    case "HPM":
                        e.Appointment.ForeColor = System.Drawing.Color.RosyBrown;
                        break;
                    case "S":
                        e.Appointment.ForeColor = System.Drawing.Color.SandyBrown;
                        break;
                    case "CO":
                        e.Appointment.ForeColor = System.Drawing.Color.RoyalBlue;
                        break;
                    case "H":
                        e.Appointment.ForeColor = System.Drawing.Color.Tomato;
                        break;
                    case "WH":
                        e.Appointment.ForeColor = System.Drawing.Color.Violet;
                        break;
                    case "OD":
                        e.Appointment.ForeColor = System.Drawing.Color.Turquoise;
                        break;
                    case "X":
                        e.Appointment.ForeColor = System.Drawing.Color.Thistle;
                        break;
                    case "HAA":
                        e.Appointment.ForeColor = System.Drawing.Color.SaddleBrown;
                        break;
                    case "HAM":
                        e.Appointment.ForeColor = System.Drawing.Color.RosyBrown;
                        break;
                    case "EMPTY":
                        e.Appointment.ForeColor = System.Drawing.Color.PaleVioletRed;
                        break;
                    case "OF":
                        e.Appointment.ForeColor = System.Drawing.Color.Pink;
                        break;
                    case "CL":
                        e.Appointment.ForeColor = System.Drawing.Color.Magenta;
                        break;
                    default:
                        e.Appointment.ForeColor = System.Drawing.ColorTranslator.FromHtml("#4E2787");
                        break;
                }
            }
        }
    }
}


Please could I know is there any option to rectify this.

Thank You

-Anto

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 24 Aug 2010, 12:40 PM
Hi Anto,

Please, see this forum thread for an explanation and solution to the problem.


Kind regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
answered on 25 Aug 2010, 12:28 PM
Hi Peter

Thank You very much.

It works fine in IE7 and in IE8.

-Anto
Tags
Scheduler
Asked by
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Answers by
Peter
Telerik team
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Share this question
or