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

reference RadGrid on content page from master

6 Answers 68 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 08 Jul 2012, 03:35 PM
Hi..

ok.. established a working setup on a content page which included a radcalendar and radgrid control that when the date is clicked it selects and displays data on the rad grid.

W hat I want to do now is place the radcalendar on my master page so that when I select a date I can update the content displayed on my radgrid and update the content page's datasource. I'm unsure how to reference a control on my content page from the master..

is there a working example somewhere?

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Jul 2012, 09:47 AM
Hello Jake,

Try the following code to achieve your scenario.
C#:
protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
{
 RadGrid grid = (RadGrid)ContentPlaceHolder1.FindControl("RadGrid1");
}

Thanks,
Shinu.
0
Jake
Top achievements
Rank 1
answered on 10 Jul 2012, 06:47 AM
ideal .. thanks Shinu..
0
Jake
Top achievements
Rank 1
answered on 11 Jul 2012, 10:55 AM
ok. This worked fine Shinu but has highlighted another issue I have, in that my RadCalendar is placed on a master page, when I click on a date information is displayed on the radgrid correctly. perfect. However if now if I click a navigation link on my master to load a new content page the RadCalendar selected day changes from my current selection to Today's date. Is there a solution to block/prevent this default date selection or target it's selection?

**update ..

I resolved this by using a session variable and setting the focused date and selected date to the same day.

what would be nicer though would be if the calendar could remain on the currently selected months without a day selected (using 1x4) month display
0
Jake
Top achievements
Rank 1
answered on 11 Jul 2012, 11:36 AM
I guess what I need actually is the first date of the currently displayed multiview radcalendar so I can store this date. ie when the user is scrolling through the calendar I need to set the 1st available date to my session variable. Which I can then use as my focusedDate. Is it possible to get this date?
0
Kevin
Top achievements
Rank 2
answered on 11 Jul 2012, 12:15 PM
Hello Jake,

To grab the first date of the Calendar you can use the following property CalendarView.ViewStartDate.

I hope that helps.
0
Jake
Top achievements
Rank 1
answered on 11 Jul 2012, 12:49 PM
thats the ticket.. perfect..
Tags
Calendar
Asked by
Jake
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jake
Top achievements
Rank 1
Kevin
Top achievements
Rank 2
Share this question
or