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

specialdays label/text issue

3 Answers 117 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Cornel Iordache
Top achievements
Rank 1
Cornel Iordache asked on 29 Dec 2009, 09:21 PM
Hello,
I am using RadControl for WinForms Q3 2009 SP1 with VS2008, C#. I am trying to reproduce the bahavoir from your demos but something must be wrong. In your demos you got two special days that display some text inside special days boxes. After reviewing your code it become obvious that source code you display for running sample is not right. For example, even the text is not same, you have in running example text  "Meeing with boss" while in the source code you can read: label2.Text = "Meeting with Microsoft";

However, even if copy/paste the entire sources it does not show text for special days, source code does not do anything except assigning two images from a list. Here is your code:

namespace Telerik.Examples.WinControls.Calendar.SpecialDays
{
    public partial class Form1 : ExamplesForm
    {
        public Form1()
        {
            InitializeComponent();

            RadLabel label1 = new RadLabel();
            label1.Text = "Ann's Birthday";

            RadLabel label2 = new RadLabel();
            label2.Text = "Meeting with Microsoft";

            this.radCalendar1.SpecialDays[0].Image = this.imageList1.Images[0];
            this.radCalendar1.SpecialDays[1].Image = this.imageList1.Images[1];
            this.radCalendar1.ShowFastNavigationButtons = false;
            this.radCalendar1.FocusedDate = new DateTime(2007, 8, 9);
        }
    }
}

I see the label definition but nothing to link them to calendar. I think your demo is incomplete and somehow unusable. I tried to find a solution by myself and come up with this:

RadLabel label1 = new RadLabel();
label1.Text = "Ann's Birthday";   
RadHostItem host = new RadHostItem(label1);   
radCalendar1.SpecialDays[0].TemplateItem = host; 

This does work but it's not the same behavoir like in your demo, text wrap and transparent label.

Could you please tell me what's the right solution to achieve my scope, assign text to a specialday, perhaps you can release correct source code of your working examples?

Regards,
Cornel I.

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 30 Dec 2009, 09:18 AM
Hello Cornel Iordache,

Thank you for reporting this. The code is correct albeit misleading. The code related to labels is not used anywhere. The text set to the labels has nothing to do with the text displayed in the special day cells since the cells contain images. Hence, I modified the example for Q1 2010.

If you do not have many special days it would be a reasonable solution to use images. The RadHostItem alternative is ok too.

Please write again if you have other questions or issues you would like to report.

Kind regards,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Cornel Iordache
Top achievements
Rank 1
answered on 30 Dec 2009, 11:35 AM
Hello Victor,

Thank you for your quick reply, I really appreciate it.

I understand that you have fixed the demo for next Q1 2010 release, anyway by that you meant that label definition and text was removed and instead you kept just images for special days or you have fixed the demo with text/label definition as well? Because this is exactly what I need and it will be very useful if you can supply such sample. If it's included in Q1 2010 an estimate date when you'll release it to your clients?

Thanks,
Cornel I.
0
Victor
Telerik team
answered on 30 Dec 2009, 11:53 AM
Hi Cornel Iordache,

Q1 2010 is to be released in the first half of March 2010. I updated the example by simply removing the labels since they are not used anywhere. Here is how the constructor looks now:

public Form1()       
{           
InitializeComponent();          
this.radCalendar1.SpecialDays[0].Image = this.imageList1.Images[0];                   this.radCalendar1.SpecialDays[1].Image = this.imageList1.Images[1];              this.radCalendar1.ShowFastNavigationButtons = false;                this.radCalendar1.FocusedDate = new DateTime(2007, 8, 9);       
}

You can use the RadHostItem approach if you need to show labels instead of images. Please write again if you have other questions.

All the best,

Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Cornel Iordache
Top achievements
Rank 1
Answers by
Victor
Telerik team
Cornel Iordache
Top achievements
Rank 1
Share this question
or