Can we Bind Json String data directly to the gridview
until what i've done is
string dtRecon = oReportsBLL.Initiate3WayRecon(objreports);
if(dtRecon !=null && dtRecon.Length > 0)
{
grd3wayInitiate.DataSource = dtRecon ;
grd3wayInitiate.DataBind();
}
and my response is like

i just want to bind the result as it is to my gridview
Can this be done? if ok pls help me
if this can't be then give me a suggestion
and i dont want to deserialize it just show as it is in the grid like json pls help me
and my grid design
Amit MohantyPosted Feb 29, 2024, 7:46 AM
No, you cannot directly bind JSON string data to a GridView control. However, you can parse the JSON string into a collection of objects (such as a list of custom classes or a DataTable) and then bind that collection to the GridView.
Example 1: By DataTable
Example 2: By Custom Class
Jignesh KumarPosted Feb 29, 2024, 3:45 AM
Hello Jaya Prakash,
Please deserialize your jason string in to data table,
Sam HobbsPosted Feb 28, 2024, 8:53 PM
If the sample JSON data you show here was shown as text then I could be more specific but it is instead shown here as an image.
If I understand your question then you must deserialize the JSON.
Vishal YelvePosted Feb 28, 2024, 2:18 PM
Hi Jaya,
do refer below article
https://www.c-sharpcorner.com/article/how-to-convert-and-bind-json-string-in-to-asp-net-gridview-with-c-sharp/
Rajeesh MenothPosted Feb 28, 2024, 11:28 AM
Hi,
You can try this :
https://learn.microsoft.com/en-us/answers/questions/715354/how-to-display-json-data-into-gridview