Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can we change a color of a speicific date cell? (Read 5665 times)
Safi Mustafa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2015
Can we change a color of a speicific date cell?
Jan 17th, 2015 at 8:02am
Print Post  
I am currently windows 2003 theme in which currently I am working on month view setting.I want to have Date on top left corner with an image on right and appointment below.So what I did is that I set header size property and removed its bottom border.
So what I have acheived so far is attached in file.
My problem is that I want to have full cell color same that is green for daily and red for recurring, with date at left and a custom added icon on top right corner.
Is there any way it can be done?

« Last Edit: Jan 17th, 2015 at 4:25pm by Safi Mustafa »  

Mind_Fusion.png ( 19 KB | 149 Downloads )
Mind_Fusion.png
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Can we change a color of a speicific date cell?
Reply #1 - Jan 19th, 2015 at 8:51am
Print Post  
Hi,

Check out the attached sample. It uses a custom presenter for the calendar cells. Cells are colored red or green depending on whether the items contained in them are regular or recurring. The cells also display a small icon in their top left corner.

Let me know if this helps.

Regards,
Meppy
  

_sample_CustomCellPresenter.zip ( 18 KB | 149 Downloads )
Back to top
 
IP Logged
 
Safi Mustafa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2015
Re: Can we change a color of a speicific date cell?
Reply #2 - Jan 19th, 2015 at 7:46pm
Print Post  
Thank you so much meppy. One more thing can you tell me how to avoid coloring padding days in custom cell presenter?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Can we change a color of a speicific date cell?
Reply #3 - Jan 20th, 2015 at 7:01am
Print Post  
Hi,

In the UpdateBackground method, change the following line:

Code
Select All
if (items.Count == 0 || IsPadding)
{
	ClearValue(CustomBackgroundProperty);
}
... 


If the cell contains no items or is a padding cell, use the default background.

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


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2015
Re: Can we change a color of a speicific date cell?
Reply #4 - Jan 20th, 2015 at 7:55pm
Print Post  
Is padding Doesnt work and secondly attached Image is shown in all the cells.I wanted to show it in just the cell a reccurence occur, so I added it in only that cell. But the problem is that even if the reccurence is daily and is finished in that cell it is shown in every month on the same date cell it was supposed to show in some specific month
  
Back to top
 
IP Logged
 
Safi Mustafa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2015
Re: Can we change a color of a speicific date cell?
Reply #5 - Jan 20th, 2015 at 8:48pm
Print Post  
I added another property named as CellHeadIcon just like custom background and binded it with image.Now what I do is that I Set this to null at the very start of updateBackground Function and set it where I need it so that it don't repeat in other months.And for padding I added this code
if (Calendar.CurrentView == CalendarView.SingleMonth)
                {
                    var FirstDayOfNextMonth = new DateTime(Calendar.Date.Year, Calendar.Date.Month, 1).AddMonths(1);
                    var FirstDayOfThisMonth = new DateTime(Calendar.Date.Year, Calendar.Date.Month, 1);
                    if (items[0].StartTime < FirstDayOfThisMonth || items[0].StartTime >= FirstDayOfNextMonth)
                        return;
                }
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint