Hi Yara,
Please find the below code snippets to bind the array of
string as datasource to the Listbox control.
[Controller]
public
ActionResult Demo()
{
List<string> data = new List<string>() { "Item1", "Item2", "Item3" };
return
View(data); // passing data source to the
listbox
}
[View]
@model
IEnumerable<string>
@Html.Orubase().ListBox("Incidents").RenderMode(RenderMode.Auto).IOS(c => c.ShowCorners(false)).BindDataSource(Model, map
=>
{
map.MapTo<string>(binding =>
{
binding.ItemDataBound((item, nd)
=>
{
item.Text = nd;
});
});
})
Also we have created sample and attached in the below link
for further reference.
ListBoxDataSource.zip
Please try this and let us know if it helps.
Regards,
Thivya.