This project is read-only.

Bind DataTable to Grid

Jan 11, 2016 at 6:07 PM
Edited Jan 11, 2016 at 6:08 PM
Quick Example.
Model

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace WebWizardDbLayer.Model
{
[DataContract]
public class FileUploadDetails
{
    [DataMember]
    public IEnumerable<dynamic> DynamicSupport
    {
        get;
        set;
    }
    [DataMember]
    public DataTable FileData
    {
        get;
        set;
    }

    [DataMember]
    public int TotalNoOfRows
    {
        get;
        set;
    }
    [DataMember]
    public int TotalNoOfCols
    {
        get;
        set;
    }
}
}


@model WebWizardDbLayer.Model.FileUploadDetails
@using GridMvc.Html
@using System.Data

@{
ViewBag.Title = "FileUpload";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@Html.Grid(Model.DynamicSupport).AutoGenerateColumns(); or @Html.Grid(Model.FileData).AutoGenerateColumns(); or @Html.Grid(Model.FileData.AsEnumerable()).AutoGenerateColumns(); Above things I have tried, let me know what can I do ? I am not able to bind the datatable to Grid