I posted the same my be in some wrong category. Please answer ASAP as I am in critical Situation.
Hi,
I am new to Kendo UI widgets and MVC4. I am using Razor View. I have a model Called Project. I have another model called Location. In Project model there is a property "List<LocationType> Locations".
On my razor form i have "@model Model.Project" and one of my multiselect widget shows me location list. I have declared it "@(Html.Kendo().MultiSelectFor(model => model.LocanTypes)". Now when I try to get "Project.Locations" in controller in [HttpPost] action I get Project.Locations as null.
Model declaration on Razor Page:
@model PestPec.Models.Project
Multiselect declartion of Multiselect:
@(Html.Kendo().MultiSelectFor(model => model.LocanTypes)
.Name("LocationTypesMultiSelect")
.Placeholder("Select Location Type(s)")
.DataTextField("Name")
.DataValueField("ID")
.Filter(FilterType.Contains)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetLocatinTypes", "Project");
});
})
)
Project.cs:
public class Project
{
public int ID { get; set; }
public string Name { get; set; }
public int Type { get; set; }
public string CreatedBy { get; set; }
public List<Technician> Technicians{get; set;}
public List<Route> Routes { get; set; }
public List<ProjService> Services { get; set; }
public List<Division> Divisions { get; set; }
public List<Branch> Branches { get; set; }
public List<LocationType> LocanTypes { get; set; }
public String Country { get; set; }
public String City { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yy}")]
public DateTime CreatedDate { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yy}")]
public DateTime LastUpdatedDate { get; set; }
}
LocationType:
public class LocationType
{
public int ID { get; set; }
public string Name { get; set; }
}
Hi,
I am new to Kendo UI widgets and MVC4. I am using Razor View. I have a model Called Project. I have another model called Location. In Project model there is a property "List<LocationType> Locations".
On my razor form i have "@model Model.Project" and one of my multiselect widget shows me location list. I have declared it "@(Html.Kendo().MultiSelectFor(model => model.LocanTypes)". Now when I try to get "Project.Locations" in controller in [HttpPost] action I get Project.Locations as null.
Model declaration on Razor Page:
@model PestPec.Models.Project
Multiselect declartion of Multiselect:
@(Html.Kendo().MultiSelectFor(model => model.LocanTypes)
.Name("LocationTypesMultiSelect")
.Placeholder("Select Location Type(s)")
.DataTextField("Name")
.DataValueField("ID")
.Filter(FilterType.Contains)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetLocatinTypes", "Project");
});
})
)
Project.cs:
public class Project
{
public int ID { get; set; }
public string Name { get; set; }
public int Type { get; set; }
public string CreatedBy { get; set; }
public List<Technician> Technicians{get; set;}
public List<Route> Routes { get; set; }
public List<ProjService> Services { get; set; }
public List<Division> Divisions { get; set; }
public List<Branch> Branches { get; set; }
public List<LocationType> LocanTypes { get; set; }
public String Country { get; set; }
public String City { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yy}")]
public DateTime CreatedDate { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yy}")]
public DateTime LastUpdatedDate { get; set; }
}
LocationType:
public class LocationType
{
public int ID { get; set; }
public string Name { get; set; }
}