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

MonthYearPicker SelectedDate

3 Answers 171 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Lane
Top achievements
Rank 1
Lane asked on 24 Apr 2014, 09:40 PM
I was looking for documentation on what the date is supposed to be of the .NET DateTime object that is returned from SelectedDate.

I would have hoped it would be the first day of the selected month/year.  But I have just discovered that sometimes it is, and sometimes it's not.

How about fixing this so it always returns the first day of the month?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Apr 2014, 05:08 AM
Hi Lane,

I guess that you want to access the first day of the month from the RadCalendar, please have a look into the C# code snippet which works fine at my end.

VB:
Protected Sub radcalFirstDay_DayRender(sender As Object, e As Telerik.Web.UI.Calendar.DayRenderEventArgs)
            'your code
    If e.Day.[Date].Day = 1 Then
    End If
End Sub

Please elaborate your requirement if it doesn't help.
Thanks,
Shinu.
0
Lane
Top achievements
Rank 1
answered on 25 Apr 2014, 04:08 PM
Thanks Shinu, but I must not have been clear in my original post.

I am talking about the RadMonthYearPicker, not the RadCalendar.

My concern is that the SelectedDate property of the RadMonthYearPicker doesn't always return the first day of the month.  I think it should.  I think this is a bug, or at the very least, poor implementation.

I know how to get the first day of the month.  I don't really need help with that.  Just posting this for Telerik to see if they can provide an explanation.  (I hope they monitor this forum.)
0
Shinu
Top achievements
Rank 2
answered on 28 Apr 2014, 04:29 AM
Hi Lane,

The selectedDate property of the RadMonthYear will return the date content of RadMonthYearPicker that we select. The default value of the selectedDate is the MinDate. So if we are not selecting any particular date from the RadMonthYearPicker it will return the MinDate value as the SelectedDate of the RadMonthYearPicker that is the expected behavior of the control.

Thanks,
Shinu.
Tags
Calendar
Asked by
Lane
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Lane
Top achievements
Rank 1
Share this question
or