Can anyone tell me ? how to get data from database and bind dropdown to grid.
WebGrid grid = new WebGrid(ViewBag.room);
@grid.GetHtml(tableStyle: "table table-bordered",
mode: WebGridPagerModes.All,
columns: grid.Columns(
grid.Column("Room Type", format:@item=>Html.DropDownList("TypeID", new SelectList(ViewBag.room, "TypeID", "TypeID"), new { @class = "form-control", id = "TypeID" }))
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Chittaranjan SwainPosted Aug 14, 2019, 3:31 AM