Hi
I want to display below data in Repeater/Gridview. Data is returned by Api response. I am using RestSharp
{"status":true,"data":{"id":"16621681","order_id":"29920015","order_number":"890","created":"2022-12-26","awb_number":"14189990126365","rto_awb":"","courier_id":"3","warehouse_id":"132002","rto_warehouse_id":"132002","status":"cancelled","rto_status":"","shipment_info":"","history":[{"status_code":"PP","location":"CAR\/HUB, Chandigarh, CHANDIGARH","event_time":"2022-12-26 19:37","message":"Pickup Not Done"},{"status_code":"PP","location":"CAR\/HUB, Chandigarh, CHANDIGARH","event_time":"2022-12-26 12:10","message":"Out for Pickup"},{"status_code":"PP","location":"CAR\/HUB, Chandigarh, CHANDIGARH","event_time":"2022-12-26 11:17","message":"Pending"}]}}
Thanks
Amit MohantyPosted Dec 28, 2022, 5:12 AM
Please debug your code while load data to rootObject and check history node has data or not. In my below code there is two gridview one for root data and other for history object data.
Amit MohantyPosted Dec 28, 2022, 10:01 AM
if history object has data then assign it to the gridview in which you want to show data.
Suppose you want to show data in GridView3 then try like below code.
Ramco RamcoPosted Dec 28, 2022, 9:28 AM
Hi Amit
Yes in rootObject it is showing . In history it is showing 3 records.
Thanks
Ramco RamcoPosted Dec 28, 2022, 4:53 AM
Hi Amit
With this it is not display History information. Kindly see the response generated
Thanks
Jignesh KumarPosted Dec 28, 2022, 4:48 AM
Please refer you previous question , https://www.c-sharpcorner.com/Forums/error-invalid-arguments
Amit MohantyPosted Dec 28, 2022, 4:30 AM
Try this
Ramco RamcoPosted Dec 27, 2022, 6:10 PM
Hi AMit
I am getting this error -
Below is the response returned
Thanks
Amit MohantyPosted Dec 27, 2022, 11:26 AM
Check this
Code
Jignesh KumarPosted Dec 27, 2022, 6:19 AM
Hi Ramco,
Please refer these article which will help you out for gridview binding,
https://www.c-sharpcorner.com/article/how-to-convert-and-bind-json-string-in-to-asp-net-gridview-with-c-sharp/