Skip to content

DevExpress-Examples/asp-net-web-forms-grid-created-at-runtime-switch-data-sources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid View for ASP.NET Web Forms - How to bind a grid created at runtime to different data sources

This example demonstrates how to add a Grid View control to a page at runtime and conditionally switch its data source.

Switch Data Sources

Implementation Details

The example application's Default page contains an ASPxRadioButtonList and three pre-configured data sources (SqlDataSource). A Grid View control is added to the page in code and bound to the data source that you select from the Radio Button List.

The grid's view state is enabled in this example. Because of this, when the grid is added to the page, it restores its columns from the view state. To generate the columns from scratch when the data source has been changed, clear the ASPxGridView.Columns collection before you call the ASPxGridView.DataBind method.

Files to Review

Documentation

More Examples

Does This Example Address Your Development Requirements/Objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Bind an ASPxGridView created at runtime to different data sources

Topics

Resources

License

Stars

Watchers

Forks

Contributors