I am using a ODataVirtualDataSource as the data source for my IgrDataGrid. I have followed the example given in the documentation, but when data is successfully returned, it is not bound to the grid. What might I do to get this to work?
Code:
import React from 'react' import { IgrDataGrid, IgrDateTimeColumn, IgrTextColumn, IgrGridColumnOptionsModule } from 'igniteui-react-grids' import testData from './SyncStatusHistoryTestData' import { IgrDataGridModule } from 'igniteui-react-grids'; import { ODataVirtualDataSource } from 'igniteui-react-datasources'; import { odatajs } from 'odatajs'; export class SyncStatusHistoryView extends React.Component { constructor(props) { super(props); IgrDataGridModule.register(); IgrGridColumnOptionsModule.register(); const vds = new ODataVirtualDataSource(); vds.baseUri = "https://localhost:44384/odata"; vds.entitySet = "SyncStatusHistory"; vds.responseDataKey = "value"; this.virtualData = vds; } render() { return ( <IgrDataGrid dataSource={this.virtualData} autoGenerateColumns={true}> </IgrDataGrid> ) } }
Returns from Api:
Hello Philip,
Your code is looking correct to me. Which doc link did you follow?
Are you getting any console error?
The only thing i see missing is not setting the width and height to the grid,Try that out if this help.
Regards,