I want to create a form like above,
also have to populate Viewer User Groups accodrding to UserGroups table

public partial class UserGroup
{
public string UserGroup_ID { get; set; }
public string UserGroupNameEn { get; set; }
}
So populate this user groups and get the filled data I created new model (so it can apply to view (1st image))
I followed theses Stack overflow question 1 and question 2 to make this
this is controller class for this
[HttpGet]
public ActionResult ProductFields_Create()
{
var model = new ProductFields
{
LisGroups = GetUserGroupListEn()
};
return View(model);
}
public MultiSelectList GetUserGroupListEn()
{
return new MultiSelectList(db.UserGroup.ToList(), "UserGroup_ID", "UserGroupNameEn");
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult ProductFields_Create(ProductFields product_fields)
{
...........
}
this is model class for first image
public class ProductFields
{
public string ProductFieldID { get; set; }
public string ProductFieldNameEn { get; set; }
public string ProductFieldNameAr { get; set; }
public string ProdcutFieldDiscriptionEn { get; set; }
public string ProductFieldDiscriptionAr { get; set; }
public List<UserGroup> LisGroups { get; set; }
[Required]
public string SelectedGroupID { get; set; }
}
viewpage for above view
@model Project_Name.Models.ProductFields
@using (Html.BeginForm())
{
<fieldset>
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
.....
<div class="form-group">
<div>
@Html.ValidationMessageFor(x => x.SelectedGroupID)
foreach (var group in Model.LisGroups)
{
<div>
@Html.RadioButtonFor(x => x.SelectedGroupID, group.UserGroup_ID, new { id = "emp" + group.UserGroup_ID })
@Html.Label("emp" + group.UserGroup_ID, employee.Label)
</div>
}
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
</fieldset>
}
but here I'm getting major errors with red squiggly lines
The name 'group' does not exist in the current context
Cannot implicitly convert type 'System.Web.Mvc.MultiSelectList' to 'System.Collections.Generic.List'


