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

Bind RadGrid on Master Page to DataSource on Content Page

2 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
msigman
Top achievements
Rank 2
msigman asked on 22 Sep 2009, 05:57 PM
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 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 23 Sep 2009, 02:57 AM
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.
-Todd
0
Kamal
Top achievements
Rank 1
answered on 25 Feb 2015, 04:42 AM
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.

Thanks
Tags
Grid
Asked by
msigman
Top achievements
Rank 2
Answers by
Todd Anglin
Top achievements
Rank 2
Kamal
Top achievements
Rank 1
Share this question
or