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
greeshma kb
NA
16
3.2k
Grid.MVC in asp.net mvc
May 21 2019 12:08 AM
Unable to bind dynamic DataTable to Grid.MVC
I want to use Grid.MVC to create a grid (table). In this grid I want to bind to a DataTable, which is the Table I get from SELECT * FROM TABLE
My view looks like this:
@model DataTable @{ ViewBag.Title = "ViewTable"; } @using GridMvc.Html @using System.Data <h2>ViewTable</h2> @Html.Grid(Model.Columns.Cast<IEnumerable<DataColumn>>()).Columns(columns => { columns.Add().RenderValueAs(a => Html.ActionLink("Edit", "Index")); foreach (DataColumn item in Model.Columns) { try { columns.Add(a => item).Titled(item.ColumnName); } catch (Exception) { throw; } } })
This always throws the error column item already exists in the grid (at the second item).
Reply
Answers (
6
)
how to bind bind dropdown list from postgres in asp.net
Auto Login to Web Application