Hi Andrea,
Thanks for your interest in Syncfusion products.
We glad to inform you that your requirement can be achieved using the below code snippet.
[Script]
<script type="text/javascript">
$(function()
{
$('#DialogEditSave').click(function ()
{
var select = $('#Hobby');
var arr = [];
$('#Hobby option:selected').each(function ()
{
arr.push($(this).val());
});
$('#Hobbies').val(arr);
}).change();
})
</script>
[EditorTemplate.cshtml]
@Html.ListBox("Hobby", ViewData["hobbieslist"] as MultiSelectList)
@Html.Hidden("Hobbies")
[EditingController.cs]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult OrderSave(EditDetails ord, string[] Hobbies)
{
string hoby=string.Join("", Hobbies);
ViewData["hobbieslist"] = GetHobbies(hoby.Split(','));
ord.Hobby = hoby;
DetailsRepository.Update(ord);
var data = DetailsRepository.GetAllRecords();
return data.GridJSONActions<EditDetails>();
}
For your convenience we have attached a sample. Could you use that sample and get back to us if you have any queries.
Let us know if you have any concerns.
Regards,
Satheeskumar S
populate_b9184e46.zip