I have database table T_HD_FUNC
with 3 fields: FUNC_ID
, FUNC_NAME
and SYS_ID
. In the controller I have some code below:
ViewBag.FUNC_ID = new SelectList(db.T_HD_FUNC.OrderBy(d => d.SORT), "FUNC_ID", "FUNC_NAME", "SYS_ID");
Inside the view I have some code below:
@Html.DropDownList("FUNC_ID", (IEnumerable<SelectListItem>)ViewBag.Area_ID, "Select menu", new { @class = "form-control" })
The result: display value and Name like this image below
But sometime, We want display to display more than one field attribute. In this case I want display attribute filterid
for column SYS_ID
like this.
<option value="1" filterid = "1">Style master</option>
<option value="2" filterid = "2">Styles Development</option>
<option value="7" filterid = "1">Style Listing Gallery</option>
How can I achieve like this? Thanks