Adding column at run time based on condition

Aug 21, 2013 at 5:53 PM
How can we add column at run time based on if condition.If condition is true,Column 'll be added.Otherwise It should be hidden.
Aug 22, 2013 at 10:16 AM
Hi, you can check condition in the Columns method:
        if (Model.ShowNumberColumn)
            columns.Add(o => o.Number)
Aug 27, 2013 at 10:55 AM
if (HttpContext.Current.Session["role"].ToString() == "Auditor")
i did the same but error comes.

Cannot convert lambda expression to type 'GridMvc.Columns.IGridColumn<Audit_Management.Models.ProjectLeadIssue>' because it is not a delegate type at
Aug 27, 2013 at 2:29 PM
I repeate your code and don't have any problems. Can you show all your grid layout/