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

Calendar Specialdays

14 Answers 275 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Segurihigiene Medicina no Trabalho, SA
Top achievements
Rank 1
Segurihigiene Medicina no Trabalho, SA asked on 25 Mar 2010, 07:26 PM
hi,

i have a calendar and i am adding a special days list by user.
the first time i all goes well but when i tried to change the user and show the special days for the changed user it stays with the first user specialDays.

Can anyone help me please,

Tanks in advanced,

Best regards,

hasm


14 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 26 Mar 2010, 06:15 PM
Hello,

Thank you for the question.

Please note that before adding the SpecialDays of the second user you should clear the SpecialDays collection of the first user. I am attaching a sample project which behaves correctly on my side. If you continue experiencing the issue even after you clear the SpecialDays collection, please send me a sample project which demonstrates the issue. You can send the project in the support ticket that you have opened. This will allow me to help you further.


Greetings,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Segurihigiene Medicina no Trabalho, SA
Top achievements
Rank 1
answered on 29 Mar 2010, 12:34 PM
Hi ,
tanks for the answer.

Ok, what i am doing is this

 

foreach (DataRow dr in dt.Rows)

{

//rCal.SpecialDays.Remove(new RadCalendarDay(Convert.ToDateTime(dr["data"]).Date));

var rlbi = new RadListBoxItem(Convert.ToDateTime(dr["data"]).Date.ToShortDateString());

rLBDates.Items.Add(rlbi);

lbl = new RadLabel

{

Text = Convert.ToDateTime(dr["data"]).Day.ToString(),

TextAlignment = ContentAlignment.MiddleCenter,

BackColor = Color.ForestGreen,

ForeColor = Color.DarkViolet

};

lbl.BringToFront();

hostItem = new RadHostItem(lbl)

{

ToolTipText =

dr["idTecnico"] + "-" + dr["tecnicoNome"] + "-" + dr["estado"] + " ",

BackColor = Color.ForestGreen,

ForeColor = Color.DarkViolet

};

hostItem.BringToFront();

rcd = new RadCalendarDay(dc)

{

TemplateItem = hostItem,

Date = Convert.ToDateTime(dr["data"].ToString()),

ToolTip = "dsdsadas",

};

dc.Add(rcd);

}
so when i make rCal.SpecialDays.clear() it does nothing...

Can you help me please.

Tanks in advanced,

Best regards,

Helder Marques

0
Nikolay
Telerik team
answered on 01 Apr 2010, 06:42 AM
Hi Helder,

You can find the answer to your question in the support ticket that you have opened.

In case our community is interested in the topic, here is my response in the ticket:
I am still not able to reproduce the describe issue. Please refer to the updated sample project attached to my current reply. Since I am not able to reproduce the issue in a sample project it seems that there is something special in your project which makes the issue appear. Please send me this project as it will allow me to investigate your case in details and provide you with further assistance.

Kind regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
sonam
Top achievements
Rank 1
answered on 11 Apr 2011, 05:50 AM
Hi Telerik,
 what i am asking here , has already asked by me in a saperate thread, but u did not answer me.
i want to display a calender in silverlight with special days selected.but in silverlight i found that special days proeprty is not there in radcalender,raddatepicker and other calender controls (if i am correct).
pls lt me know how to acheive it in silverlight as soon as possible.
0
Yana
Telerik team
answered on 11 Apr 2011, 12:43 PM
Hello,

Please check the reply in the other forum thread here:
http://www.telerik.com/community/forums/silverlight/calendar/radcalender-control-problem.aspx

Best wishes,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
flanky
Top achievements
Rank 1
answered on 14 Apr 2011, 09:33 AM
Hi.
I find that if i have more than 90 special days put into Radcalendar.it takes more than 7 seconds to load the redcalendar.
It is too slow.
Do you have any idea about this?
thanks in advance!
0
Accepted
flanky
Top achievements
Rank 1
answered on 14 Apr 2011, 09:53 AM
I find the solution!
Do not add the special days  into radcalendar one by one,just put the special days into a collection first,then add the collcetion into radcalendar at a time. It wroks! less than 1s.

0
Brendan
Top achievements
Rank 1
answered on 27 Mar 2013, 06:00 PM
I am using the Telerik controls from Winforms_2013_1_220.  No matter what I do I cannot get the special days tooltip to show up or work.  I downloaded the 'RadCalSpecialDays' project and the tooltip did not work there either.  Is this broken in the version I am using?  Or am I doing something wrong. 

From the getting started calendar video it looks as though I should be able to add a RadCalender, add a special day, add a tooltip (in the video they used July 4, Independence Day).  When I run the project the tooltip should work, but it doesn't.  I have AllowTooltips and ShowItemTooltips set to True.

In code I have also tried;
        Dim myDay As DateTime = "2013-01-15"
        calMyEvents.SpecialDays.Add(New RadCalendarDay(New DateTime(myDay.Year, myDay.Month, myDay.Day, 0, 0, 0)))
        calMyEvents.SpecialDays(myDay).ToolTip = "My Tooltip"
        calMyEvents.FocusedDate = myDay
0
Stefan
Telerik team
answered on 01 Apr 2013, 08:01 AM
Hi Brendan,

Can you please also set the AutoToolTip property of the visual element as follows:
Private Sub RadCalendar1_ElementRender(sender As Object, e As Telerik.WinControls.UI.RenderElementEventArgs) Handles RadCalendar1.ElementRender
       e.Element.AutoToolTip = True
   End Sub

Let me know how this works for you.

All the best,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Brendan
Top achievements
Rank 1
answered on 01 Apr 2013, 07:45 PM
Hi Stefan.  When I set "e.Element.AutoToolTip = True", it shows a tooltip for the day number, not the tooltip I set.  For example, if I hover over March 15, the tooltip is "15".  In fact every day now has it's own tooltip.
0
Stefan
Telerik team
answered on 04 Apr 2013, 02:20 PM
Hi Brendan,

Please excuse me for the introduced confusion. It seems that this is an issue with this and it is already logged in our  
Public Issue Tracking System. Feel free to add your vote for it here: http://www.telerik.com/support/pits.aspx#/details/Issue=12988.

For the time being you can use the ToolTipText needed event instead:
Private Sub RadCalendar1_ToolTipTextNeeded(sender As Object, e As Telerik.WinControls.ToolTipTextNeededEventArgs) Handles RadCalendar1.ToolTipTextNeeded
    Dim cell As CalendarCellElement = TryCast(sender, CalendarCellElement)
    If cell IsNot Nothing Then
        If cell.SpecialDay = True Then
            e.ToolTipText = "Special day"
        Else
            e.ToolTipText = "Normal day"
        End If
    End If
End Sub

I hope this helps.

Kind regards,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Brendan
Top achievements
Rank 1
answered on 04 Apr 2013, 02:46 PM
Thanks Stefan, but I don't think that is going to work.  I need to load several dates from a db for specific users and would have this type of info;
02/15/2012, "Payment Due"
03/22/2012, "Reset Rates"
03/05/2012, "Business Holiday"
etc. for many records.

I need to add the tooltip when I add the date to the calendar as I'm not sure how I could 'know' what the tooltip during the Tooltip_Needed event? I don't want to re-query the database every time I need a tooltip. 

If there was a .tag for the special day I could add the Tooltip there and call it later on the Tooltip_needed event, but I don't see anything like that.

Unless there are other suggestions?
0
Stefan
Telerik team
answered on 05 Apr 2013, 11:24 AM
Hello Brendan,

I can suggest using a Hashtable to store your tooltips instead of a Tag. When you populate the SpecialDays, populate the hashtable and then use it in the ToolTipTextNeeded event:
Imports Telerik.WinControls.UI
 
Public Class Form1
    Dim tooltips As Hashtable = New Hashtable
 
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim myDay As DateTime = "2013-04-15"
        RadCalendar1.SpecialDays.Add(New RadCalendarDay(New DateTime(myDay.Year, myDay.Month, myDay.Day, 0, 0, 0)))
        RadCalendar1.SpecialDays(myDay).ToolTip = "My Tooltip"
        tooltips.Add(myDay, "tooltip for " + myDay.ToString())
        RadCalendar1.FocusedDate = myDay
    End Sub
 
    Private Sub RadCalendar1_ToolTipTextNeeded(sender As Object, e As Telerik.WinControls.ToolTipTextNeededEventArgs) Handles RadCalendar1.ToolTipTextNeeded
        Dim cell As CalendarCellElement = TryCast(sender, CalendarCellElement)
        If cell IsNot Nothing Then
            If tooltips.Contains(cell.Date) Then
                Dim tooltip As String = CStr(tooltips(cell.Date))
                e.ToolTipText = tooltip
            End If
        End If
    End Sub
End Class

Let me know how this works for you.
 
All the best,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Brendan
Top achievements
Rank 1
answered on 12 Apr 2013, 07:03 PM
Thank you Stefan for the help on this workaround.  It works very nicely.

Brendan
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Segurihigiene Medicina no Trabalho, SA
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Segurihigiene Medicina no Trabalho, SA
Top achievements
Rank 1
sonam
Top achievements
Rank 1
Yana
Telerik team
flanky
Top achievements
Rank 1
Brendan
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or