Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
React Grid Virtual Datasource
posted

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:

Parents
No Data
Reply
  • 7375
    Offline posted

    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,

Children
No Data