Bind COmbo select values from Database

Hi i was looking to Bind Dhtmlx Lightbox combo select with the values from Database… I’m using DHTMLX standard edition and added required JS and CSS file. Here is my MVC controller

public JsonResult BindActivity()
{
var lstTaskSchedule = new SelectList(new[]
{
new { key=“1”, label=“Hello 1”},
new { key=“2”, label=“Hello 2”},
new { key=“3”, label=“Hello 3”},
new { key=“4”, label=“Hello 4”},
}, “key”, “label”, 1);
return Json(lstTaskSchedule, JsonRequestBehavior.AllowGet);
}

Here is my Jquery code

var Activity = scheduler.load("/TaskScheduler/BindActivity");

scheduler.config.lightbox.sections = [
{ name: “text”, height: 100, map_to: “text”, type: “textarea”, focus: true }, //Here it is a textbox
{ name: “Activity”, options: Activity, map_to: “Activity”, type: “combo”, image_path: “…/Content//DHTMLX/imgs/”, height: 30, filtering: true }, //Here i’ve created Select for Activity Type
{ name: “time”, height: 72, type: “time”, map_to: “auto” } //This will show time period
];

Hello,
scheduler.load retreives calendar data and parses it into the component, it is not designed to be used for generic ajax requests.
Try using jquery .get for loading options[code]$.get( “/TaskScheduler/BindActivity”, function( data ) {
scheduler.updateCollection(“comboOptions”, data);
});

scheduler.config.lightbox.sections = [
{ name: “text”, height: 100, map_to: “text”, type: “textarea”, focus: true }, //Here it is a textbox
{ name: “Activity”, options: scheduler.serverList(“comboOptions”), map_to: “Activity”, type: “combo”, image_path: “…/Content//DHTMLX/imgs/”, height: 30, filtering: true }, //Here i’ve created Select for Activity Type
{ name: “time”, height: 72, type: “time”, map_to: “auto” } //This will show time period
];[/code]