开发者

asp.net mvc selectlist

开发者 https://www.devze.com 2023-01-13 06:59 出处:网络
by using selectlist how can i enter the please select. is there a way GrpDown = new SelectList(_db.Groups.Where(m => m.vcr_GroupName != \"SuperAdmin\" &am开发者_开发技巧p;& m.int_Priority >

by using selectlist how can i enter the please select. is there a way

 GrpDown = new SelectList(_db.Groups.Where(m => m.vcr_GroupName != "SuperAdmin" &am开发者_开发技巧p;& m.int_Priority >= Authorization.Priority && m.bit_Active == true).ToList(), "int_GroupId", "vcr_GroupName");


I hope I've understoon your question. Try something along these lines:

var ListOfThings = _db.Groups.Where(m => m.vcr_GroupName != "SuperAdmin" && m.int_Priority >= Authorization.Priority && m.bit_Active == true).ToList();

ListOfThings.Insert(0, "Please Select"); // <-- Here you want to enter an item that has the caption "Please Select"

GrpDown = new SelectList(ListOfThings, "int_GroupId", "vcr_GroupName"); 
0

精彩评论

暂无评论...
验证码 换一张
取 消