I'm having a problem where the NeedDataSource event of the grid is not firing on initial load when I load and add a user control containing a grid in a Place Holder control. I don't experience the same problem when loading and adding the user control in a RadPageView. The user control loads and runs through the normal lifecycle, but the grid's NeedDataSource Event doesn't fire when adding it to a place holder. The NeedDataSource method is wired to the grid's event and works as expected when the user control is added to other controls. Any ideas on why it doesn't fire would be appreciated.
Never gets called
| UserControlwGrid userControlwGrid = (UserControlwGrid)LoadControl("UserControlwGrid.ascx"); |
| userControlwGrid.ID = "userControlwGrid"; //Set additional Properties of User Control |
| placeholder.Controls.Add(userControlwGrid); |
| UserControlwGrid userControlwGrid = (UserControlwGrid)LoadControl("UserControlwGrid.ascx"); |
| userControlwGrid.ID = "userControlwGrid"; //Set additional Properties of User Control |
| RadPageView.Controls.Add(userControlwGrid); |
Never gets called
| protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| radGrid.DataSource = GetMyDataSource(); |
| } |