Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmDataGrid, switch between 2 datasources-- How-to
Message
From
28/02/2005 17:01:03
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
MmDataGrid, switch between 2 datasources-- How-to
Miscellaneous
Thread ID:
00991386
Message ID:
00991386
Views:
54
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 I 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,
Reply
Map
View

Click here to load this message in the networking platform