Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmDataGrid, switch between 2 datasources-- How-to
Message
De
28/02/2005 17:01:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
MmDataGrid, switch between 2 datasources-- How-to
Divers
Thread ID:
00991386
Message ID:
00991386
Vues:
55
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,
Répondre
Fil
Voir

Click here to load this message in the networking platform