reference RadGrid on content page from master

7 posts, 0 answers
  1. Jake
    Jake avatar
    15 posts
    Member since:
    Aug 2012

    Posted 08 Jul 2012 Link to this post

    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?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jul 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jake
    Jake avatar
    15 posts
    Member since:
    Aug 2012

    Posted 10 Jul 2012 Link to this post

    ideal .. thanks Shinu..
  5. Jake
    Jake avatar
    15 posts
    Member since:
    Aug 2012

    Posted 11 Jul 2012 Link to this post

    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
  6. Jake
    Jake avatar
    15 posts
    Member since:
    Aug 2012

    Posted 11 Jul 2012 Link to this post

    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?
  7. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Hello Jake,

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

    I hope that helps.
  8. Jake
    Jake avatar
    15 posts
    Member since:
    Aug 2012

    Posted 11 Jul 2012 Link to this post

    thats the ticket.. perfect..
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017