- Home
- Forum
- React - EJ 2
- DataManager with ODataV4: Not displaying on the Grid
DataManager with ODataV4: Not displaying on the Grid
My Asp.Net Core API responds with this:
{
"@odata.context": "https://localhost:44300/odata/$metadata#MemberSummaryInfo",
"value": [
{
"membId": "000163000010",
"company": "ABCD",
"pbp": "001",
"contractCode": "H3815",
"homePhone": "3452351234",
"seq": 0,
"mbrEffDt": null,
"mbrTermDt": null,
"lastNm": "WHITE",
"firstNm": "BUNNY",
"mi": "",
"gender": null,
"dob": "0001-01-01T00:00:00-08:00",
"opt": null,
"hic": null,
"pcp": null
}
]
}
It does not bind and the grid displays nothing.
{
"@odata.context": "https://localhost:44300/odata/$metadata#MemberSummaryInfo",
"value": [
{
"membId": "000163000010",
"company": "ABCD",
"pbp": "001",
"contractCode": "H3815",
"homePhone": "3452351234",
"seq": 0,
"mbrEffDt": null,
"mbrTermDt": null,
"lastNm": "WHITE",
"firstNm": "BUNNY",
"mi": "",
"gender": null,
"dob": "0001-01-01T00:00:00-08:00",
"opt": null,
"hic": null,
"pcp": null
}
]
}
It does not bind and the grid displays nothing.
<GridComponent
dataSource={dm}
allowPaging={true}
pageSettings={{ pageSize: 50, pageSizes: [25, 50, 100] }}
height={Math.max(window.innerHeight - 603, 600)}
rowHeight={50}
allowResizing={true}
allowSorting={true}
allowMultiSorting={true}
>
<ColumnsDirective>
<ColumnDirective field='membId' headerText='Member ID' width='120' textAlign="Right"/>
<ColumnDirective field='company' headerText='Plan Group' width='150'/>
<ColumnDirective field='pbp' headerText='Plan' width='150'/>
<ColumnDirective field='contractCode' headerText='Contract' width='150'/>
</ColumnsDirective>
<Inject services={[Page, Sort, Resize]} />{' '}
</GridComponent>
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
PG
Praveenkumar Gajendiran
Syncfusion Team
June 14, 2021 08:24 AM UTC
Hi Emmanuel,
Greetings from Syncfusion support.
Based on your query, we would like to inform you that while using OdataV4Adaptor, The response returned from OData service must be in the below format from which the count and data is assigned to the Grid to bind data.
Based on your query, we would like to inform you that while using OdataV4Adaptor, The response returned from OData service must be in the below format from which the count and data is assigned to the Grid to bind data.
So, we suggested to return the response object in the above mentioned format to bind the data properly in your Grid application while using OdataV4Adaptor.
More details on this can be checked in the below documentation link,
Documentation Link: https://ej2.syncfusion.com/react/documentation/grid/data-binding/#binding-with-odata-v4-services
Please get back to us if you need further assistance.
Regards,
Praveenkumar G
Marked as answer
EP
Emmanuel Pandy
June 14, 2021 09:45 PM UTC
Thank you. Following your suggestion, it is now working.
PG
Praveenkumar Gajendiran
Syncfusion Team
June 15, 2021 10:19 AM UTC
Hi Emmanuel,
You are welcome. We glad that the provided solution resolved your requirement.
Please get back to us if you need further assistance.
Regards,
Praveenkumar G
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
EP Emmanuel Pandy
- Jun 12, 2021 01:48 AM UTC
- Jun 15, 2021 10:19 AM UTC