Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
igGrid can not display Data
posted

Hello,

I want to display C# DataTable Data on igGrid But not display plz any one can help

Code:

 public JsonResult BindGridVirtualization()
        {
            MMDataModelDataContext _db = new MMDataModelDataContext(_getString.GetSQLString());
            GridVirtualizationModel model = new GridVirtualizationModel();
            this.InitializeGridVirtualization(model.GridVirtualization);     


            DataTable table = GetMealTable();           
            var value = from c in table.AsEnumerable().AsQueryable()
                            select c;
            model.GridVirtualization.DataSource = value;
            return model.GridVirtualization.GetData();
        }

private DataTable GetMealTable()

{

DataTable tbl = new DataTable();

foreach (string str in columns)
            {
                tbl.Columns.Add(str,typeof(string));
            }

 var value = from c in _db.GetTable<tblMeal>()
                        //where Convert.ToDateTime(c.Date).ToString("dd/MM/yyyy").Contains(con)
                        where c.Date.Contains(con)
                        orderby c.Date ascending

                        select c;

DataRow tr = tbl.NewRow();

 foreach (tblMeal ob in value)

{
        tr = tbl.NewRow();

        tr[ob.MemberNickName] = ob.Amount;

        tr["Date"] = ob.Date;tbl.Rows.Add(tr);

}

return tbl;

}