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

Setting MonthView.VisibleAppointmentsPerDay property in OnDataBound event is raising javascript error

2 Answers 79 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Venu Krishnamoorthy
Top achievements
Rank 1
Venu Krishnamoorthy asked on 02 Jan 2009, 01:23 PM
Hello,

We are using 2008.3.1125.35 version RadScheduler. Problem occurs in month view for showing number of appointments per day.
We have set MonthView.VisibleAppointmentsPerDay property default to 4 at design time. And our appointments are span across multiple days. There is a scenario where there are more then 4 appointments on a given day, where it shows additional appointments in the "More"  option, but does not render any appointments for its subsequent days and left it blank.

If we set MonthView.VisibleAppointmentsPerDay property at runtime, we are getting "Microsoft JScript runtime error: 'null' is null or not an object" error in OnDataBound event.

Following is a code:

eg.

  protected void FiscalScheduler_DataBound(object sender, EventArgs e)
  {   
      FiscalSchedular.MonthView.VisibleAppointmentsPerDay = 3;
  }

The javascript error will be raised if a user is hovering the rendered appointments.

Thanks,
Venu

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Jan 2009, 11:49 AM
Hi Venu,

If you need to set the VisibleAppointmentsPerDay proerty dynamically, please use the page load event instead of RadScheduler's DataBound event:

  protected void Page_Load(object sender, EventArgs e)  
    {  
        if(!IsPostBack)  
            RadScheduler1.MonthView.VisibleAppointmentsPerDay = 3;  
      } 

Other than that, I am not sure what problems you experience when using this property. Could you please be more specific and provide us the exact steps needed to observe the issue?



Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Venu Krishnamoorthy
Top achievements
Rank 1
answered on 07 Jan 2009, 04:34 AM
Hello,

What I want is to set VisibleAppointmentsPerDay property to the Maximum number of appointments for selected month. Also we are modifying the Scheduler DataSource at runtime, therefore not setting this property in PageLoad. So, we tried a similar solution given in following link:

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/displaying-items-per-day-in-monthview-with-no-restriction.aspx#434270

It loads the appointments as per needed. However, it raise following javascript error when user hovers on any appointment.
"Microsoft JScript runtime error: 'null' is null or not an object"

However, we have implemented same functionality as per following link and it works fine as per our requirement.
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-show-all-appointments-in-month-view.aspx

Thanks,
Venu
Tags
Scheduler
Asked by
Venu Krishnamoorthy
Top achievements
Rank 1
Answers by
Peter
Telerik team
Venu Krishnamoorthy
Top achievements
Rank 1
Share this question
or