Skip to main content
A newer version of this page is available. .

GridControl.RefreshDataSource() Method

Updates the GridControl.MainView to reflect changes made to a data source.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v19.1.dll

Declaration

public virtual void RefreshDataSource()

Remarks

Call the RefreshDataSource method to update data displayed within the grid control’s GridControl.MainView. The method reloads all records from the grid’s associated data source for this purpose. Note that calling the method makes sense only when the bound data source doesn’t support the IBindingList interface. Otherwise, the control will automatically update itself.

Important

These automatic updates include information about added and\or removed rows. Changes made to existing rows are not recognized, unless the data source IBindingList object implements the System.ComponentModel.INotifyPropertyChanged interface.

To reload data within detail Views, use the ColumnView.RefreshData method.

Note

Do not call the RefreshDataSource method if you only need to update certain rows, since this method forces the entire grid to re-draw and negatively affects the application performance. In this scenario, utilize the ColumnView.RefreshRow method instead.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RefreshDataSource() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also