Skip to main content

GridControl.RefreshDataSource() Method

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

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v26.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

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. Calling the RefreshDataSource method makes sense only when the bound data source doesn’t support the IBindingList interface. Otherwise, the grid control will automatically update itself.

The RefreshDataSource method does not work when the grid control is bound to the IQueryable source.

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.

See Also