Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am new in JSON. Kindly let me know how to bind Dropdown List inside ASP.NET Gridview within ItemTemplate Using JSON. I am binding gridview using JSON.

Thanks& Regards,
Atul Sharma
Posted
Updated 4-Jan-15 23:14pm
v2
Comments

1 solution

No need to go for json. Just use RowCommand Event and inside that Bind your DropDownList.

Refer the example - How to populate DropDownList in GridView in ASP.Net[^].
 
Share this answer
 
Comments
AtulOmSharma 5-Jan-15 5:17am    
Dear Tadit,
I am binding my gridview using JSON so i need to bind Dropdownlist within Item Template inside gridview using JSON with Web Service
Then you must be looping for each records in json, right?

If yes, then inside the loop, get the json data for the DropDownList. Find the DropDownList for that row and bind it. Something like below will be used to loop through the DropDownList json items and bind them to DropDownList.

$.each(Result, function (key, value) {
$("#ddlcountry").append($("<option></option>").val(value.CountryId).html(value.CountryName));
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900