TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sagar Bandkar
NA
347
49.1k
Webgrid Exception in mvc
Oct 25 2016 5:49 AM
Exception:-A data source must be bound before this operation can be performed.
I am using webgrid to display data and i am using validation ,when my code (vcCtgCode) is null
it display above exception ,How to Overcome the exception.
@model IEnumerable<******.Model.tblMstCategory_CTG>
<div>
@{
var grid = new WebGrid(Model, ajaxUpdateContainerId: "inCtgId");
@grid.GetHtml(
tableStyle: "webgrid-table",
headerStyle: "webgrid-header",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-alternating-row",
selectedRowStyle: "webgrid-selected-row",
rowStyle: "webgrid-row-style",
htmlAttributes: new { id = "Grid" },
//mode: WebGridPagerModes.All,
columns: new[]
{
grid.Column("inCtgId",header:"Id")
,grid.Column("vcCtgCode",header:"Code",format: (item)=> string.IsNullOrEmpty(item.vcCtgCode)?string.Empty:item.vcCtgCode)
})
}
</div>
Reply
Answers (
3
)
button border CSS Issue
pagination in asp.net