here i have one dropdown inside gridview
My question is i want to bind data inside dropdown using client context or csom
i am using developer site for App developement and list also in thesee
bind that productname colum
thank u advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
satish babuRank #2,232 · 629 reputationPosted Aug 27, 2014, 11:29 PM EDT
function displayLists() {
// Get the available SharePoint lists, and then set them into
// the context.
lists = web.get_lists();
context.load(lists);
context.executeQueryAsync(onGetListsSuccess, onGetListsFail);
}
function onGetListsSuccess(sender, args) {
// Success getting the lists. Set references to the list
// elements and the list of available lists.
var listEnumerator = lists.getEnumerator();
var selectListBox = document.getElementById("selectlistbox");
if (selectListBox.hasChildNodes()) {
while (selectListBox.childNodes.length >= 1) {
selectListBox.removeChild(selectListBox.firstChild);
}
}
// Traverse the elements of the collection, and load the name of
// each list into the dropdown list box.
while (listEnumerator.moveNext()) {
var selectOption = document.createElement("option");
selectOption.value = listEnumerator.get_current().get_title();
selectOption.innerHTML = listEnumerator.get_current().get_title();
selectListBox.appendChild(selectOption);
}
}