Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Readonly cells (Read 2951 times)
zodraz
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 29
Joined: Jan 14th, 2011
Readonly cells
Mar 1st, 2011 at 8:39am
Print Post  
Hi,

       I would like to know where is the style(property) that gives the possibility on a certain day of a month calendar display to be ONLY readonly, so user cannot interact with that cell/day...

Thanks

Zodraz

  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Readonly cells
Reply #1 - Mar 1st, 2011 at 1:16pm
Print Post  
There is no property for this purpose but you can utilize the Calendar.ItemModifying and Calendar.ItemCreating events. In the handlers of these events you can validate user interactions and eventually reject them. Here is an example code which does not allow items to be created or dragged over a period of time (Mar, 10th - Mar, 16th):

Code
Select All
private void calendar_ItemModifying(object sender, ItemModifyConfirmEventArgs e)
{
      if (Intersects(e.Item.StartTime, e.Item.EndTime, DisabledZoneStart, DisabledZoneEnd))
            e.Confirm = false;
}

private void calendar_ItemCreating(object sender, ItemConfirmEventArgs e)
{
      if (Intersects(e.Item.StartTime, e.Item.EndTime, DisabledZoneStart, DisabledZoneEnd))
            e.Confirm = false;
}

private static readonly DateTime DisabledZoneStart = new DateTime(2011, 3, 10);
private static readonly DateTime DisabledZoneEnd = new DateTime(2011, 3, 17);

private static bool Intersects(DateTime start1, DateTime end1, DateTime start2, DateTime end2)
{
      return start2.Ticks < end1.Ticks && start1.Ticks < end2.Ticks;
} 


To run the above code, please use the new version of the control from this post:

http://mindfusion.eu/Forum/YaBB.pl?board=scheduling_silverlight;action=display;n...

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
zodraz
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 29
Joined: Jan 14th, 2011
Re: Readonly cells
Reply #2 - Mar 1st, 2011 at 2:12pm
Print Post  
Like a charm another time...

Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint