Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One Grid, 2 separate DataSources.. Howto?
Message
From
28/02/2005 16:01:26
 
 
To
All
General information
Forum:
ASP.NET
Category:
WebForms
Title:
One Grid, 2 separate DataSources.. Howto?
Miscellaneous
Thread ID:
00991358
Message ID:
00991358
Views:
49
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
Next
Reply
Map
View

Click here to load this message in the networking platform