Hey folks,
I'm wanting to programmatically create a prodatasource and use it.
dataSource.ID = "ListDataSource";
dataSource.LivePersistence = false;
dataSource.PerformSelect += new EventHandler<PerformSelectEventArgs2>(dataSource_PerformSelect);
dataSource.DataContainerType = DataSourceDataContainerType.EntityCollection;
Controls.Add(dataSource);
QueryResults.DataSourceID = "ListDataSource";
This code is executing in the OnInit method of the parent control.
The problem I'm having is the dataSource doesn't appear to be being utilised. The PerformSelect event handler is never called... is it not possible to use DataSourceID at runtime?
I've tried a few combinations including setting the DataSource of the grid to the LLBLgenprocedatasource and calling DataBind... does nothing (but no errors).
Help appreciated