I have 2 datasources with the same structure. The only difference is that they contain different data. I would like a datagrid on a webform to switch between the 2 datasources when a press a command button.
In the page load event of a webform I set the first datasource.
if (!IsPostBack)
{
this.myGrid.BindingSource="Source1"
}
The page renders with the grid filled with Source1 data.
I then want to change the Datasource at the press of a button.
In the click event of button btnDataSourceChange I place:
this.myGrid.BindingSource="Source2"
this.myGrid.DataBind();
When the page posts back I get a blank grid?
Thank you,
Neil