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
20
Exception: The grid model doesn't contain a column named:
posted

Hi,

I am binding to a data source that is set in the GridDataSourceAction method as below -

List<Dictionary<string, string>> rows = new List<Dictionary<string, string>>();
            Dictionary<string, string> row = null;            

            foreach (DataRow dr in dataTable.Rows)
            {
                row = new Dictionary<string, string>();
                foreach (DataColumn col in dataTable.Columns)
                    row.Add(col.ColumnName, dr[col] == DBNull.Value ? string.Empty : dr[col].ToString());

                rows.Add(row);
            }

            
            return View(rows.AsQueryable());

I have set remote paging and remote filtering in my grid in javascript. The remote paging works successfully however the grid does not filter and the spinner keeps spinning. On closer inspection, i check the response and see that i am getting an error -

"Exception: The grid model doesn't contain a column named: KeyOfColumnImFiltering" 

I have checked the data source and can confirm i do the columns present.

Why would this be happening?

Thanks

Parents
  • 15320
    Offline posted

    Hello Hussam,

    Can you provide me with the grid initialization code and especially with the columns collection definition? Please make sure that there are no duplicate column keys and non defined columns in the grid columns collection.

Reply Children