var results = from t in context where t.Name == userName select t;RadGrid1.DataSource = results;RadGrid1.DataBind();I have a RadGRid which is populated via code behind with data from an Odata endpoint, as above.
Some of the fields returned contain dates.
I need to create a calculated column which subtracts the current from the date in one of the bound field and returns a value in days.
How can that be performed from code behind and in what event?
I can create the column as below but not sure how to setup the Expression attribute.
GridCalculatedColumn gcc = new GridCalculatedColumn();gcc.DataFields = new string[] { "CreatedDate" };gcc.Expression = ???RadGrid1.MasterTableView.Columns.AddAt(1, gcc);