Bind RadGrid on Master Page to DataSource on Content Page

3 posts, 0 answers
  1. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 22 Sep 2009 Link to this post

    I have a RadGrid on my Master page, and I'd like to put the DataSource on the content page.  (The data source will change depending on which content page is loaded).  Is this possible?
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 22 Sep 2009 Link to this post

    Hello Matthew-

    That scenario should be possible- it will just require a little code in your Content Page.

    The process should basically be this:

    1. Handle your ContentPage's PageLoad event
    2. During that event, locate the RadGrid in your MasterPage (Master.FindControl("YourRadGridId") as RadGrid)
    3. Set the grid's DataSourceId property to the ID of your data source (myGrid.DataSourceID = mySqlDataSource.ID)

    I don't have VS handy, but I'm fairly certain this should work. It should be early enough in the Page Lifecycle. Once the DataSourceId is set, the Grid will bind and behave "like normal."

    Let me know if that helps.
  3. Kamal
    Kamal avatar
    34 posts
    Member since:
    Jan 2013

    Posted 24 Feb 2015 in reply to Todd Anglin Link to this post

    Hi Todd

    Is it possible vice-a-verse. I have button in my master page. On click I need to save the RadGrid (in child page) look and feel settings.
    Means in the button click event I want to know the child page information, the rad grid, and finally save its state by GridSettingsPersister.

    I can do it with separate buttons on each individual child page. But I do not like that. Please let me know.

Back to Top