I have DropDown List In MVC .i have bind it with viewbag but i want to bind it with three columns. how can i do that.
here is my code.
i have two columns value and text..but i want to bind more than two columns..how can i do that..or is there any another way
ViewBag.RDDetails = mastRepo.GetAllRDDetail().Where(m => m.RDTId == PlanTermsId).GroupBy(m => m.RDAmount).Select(n => new { Value = n.FirstOrDefault().RDTId, Text = n.FirstOrDefault().RDAmount }).ToList();
@Html.DropDownListFor(model => model.RDTDId, new SelectList((System.Collections.IEnumerable)ViewBag.RDDetails, "Value", "Text"), new { @class = "form-control",@id="ddlAmount" })
@Html.ValidationMessageFor(model => model.RDTDId)
Go to the complete details ...