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

selecting a date from rad calendar

2 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mahendra Kumar
Top achievements
Rank 1
Mahendra Kumar asked on 21 Sep 2011, 11:49 PM
Hi,

I am not able to figure out how to select a date from the rad calendar.
Able to get the calendar popup but not able to proceed further.

Suggestion would be appreciated.

Thanks & Regards,
Mahendra 

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 22 Sep 2011, 12:03 PM
Hello Mahendra Kumar,

You can easily select a date from the RadCalendar by using the "SelectDate" method. The following code will navigate to our Calendar sample page, find the Calendar control by its ID, select date 9/12/2011 and verify the correct date is selected.
                "omization/defaultcs.aspx");
RadCalendar calendar = this.Find.ById<RadCalendar>("RadCalendar1");
 
//Select date '9/12/2011'
calendar.SelectDate("9/12/2011", "en-US");
 
Assert.IsTrue(calendar.SelectedDates.Matches(new SelectedDateCollection(new DateTime[] { DateTime.Parse("9/12/2011") })), "RadCalendar: Selected dates verification failed!");
 
Hope this helps!

Greetings,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mahendra Kumar
Top achievements
Rank 1
answered on 22 Sep 2011, 04:43 PM
Thanks a lot. That worked. I was not passing the date correctly earlier :)

Regards,
Mahendra
Tags
General Discussions
Asked by
Mahendra Kumar
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Mahendra Kumar
Top achievements
Rank 1
Share this question
or