Access the DataSource
Regardless of the data source you use, the DataGrid always wraps it in the DataSource. To get a DataSource instance, call the getDataSource() method.
jQuery
JavaScript
var ds = $("#dataGridContainer").dxDataGrid("getDataSource");
Angular
TypeScript
import { ..., ViewChild } from "@angular/core"; import { DxDataGridModule, DxDataGridComponent } from "devextreme-angular"; // ... export class AppComponent { @ViewChild(DxDataGridComponent) dataGrid: DxDataGridComponent; ds: any = {}; getDataSource () { this.ds = this.dataGrid.instance.getDataSource(); } } @NgModule({ imports: [ // ... DxDataGridModule ], // ... })
You can now call any method exposed by the DataSource. For example, you can reload data using the reload() method.
JavaScript
ds.reload();
See Also
Feel free to share demo-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you!
We appreciate your feedback.
We appreciate your feedback.