specialdays label/text issue

4 posts, 0 answers
  1. Cornel Iordache
    Cornel Iordache avatar
    2 posts
    Member since:
    Dec 2009

    Posted 29 Dec 2009 Link to this post

    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.

     

     

     

     

  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 30 Dec 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Cornel Iordache
    Cornel Iordache avatar
    2 posts
    Member since:
    Dec 2009

    Posted 30 Dec 2009 Link to this post

    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.
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 30 Dec 2009 Link to this post

    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.
Back to Top