Parent view model declaration:
public class PublishReportDataViewModal
{
public string ReportPeriodName { get; set; }
public string YearName { get; set; }
public long SchoolId { get; set; }
public bool CanPublish { get; set; }
public bool CanEmail { get; set; }
[Required(ErrorMessage = "Please select Roll Group")]
public List<RollGroupDetailsViewModel> RollGroupDetails { get; set; }
}
Child View model declaration:
public class RollGroupDetailsViewModel
{
public string RollGroup { get; set; }
public long RollGroupId { get; set; }
public string Name { get; set; }
}
Main modal is declared in my partial view page which is PublishReportDataViewModel. I'm filling several data in RollGroupViewModel which is in list and I want to show that data via Kendo multiselect drop down.
I've written below code of cshtml but it's now working.
@(Html.Kendo().MultiSelect()
.Name("rollGroupDetailsMultiSelect")
.Placeholder("Select Roll Groups")
.DataTextField("Name")
.DataValueField("Name")
.BindTo(Model.RollGroupDetails.Select(rg => rg.Name))
)
Kindly suggest me solution.
Regards, Jay Chaniyara