Hi
I am trying to use Datatable in my radgridview for items source. It works fine with premitive datatypes for columns. But when you try to add a custom object as a column, and provide a celltemplate in autogenerate columns event in code behind then the datatemplate is not picking the object context. In output window its showing a binding error from datatemplate for the properties I have provided from my object in the cell. The error for each cell I am getting in my output window is: Error: 40 : BindingExpression path error: 'PropertyValue' property not found on 'object' ''DataRow' (HashCode=45554962)'. Any idea if I am missing any thing..
Below is my code in code behind file. Assum my all columns are of same type and they need a cell template and an celledittemplate.
private void ResourcesListGridView_OnAutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
{
var editModel = Application.Current.TryFindResource(CommonKeys.CostValueModelEditor);
var cellmodel = Application.Current.FindResource(CommonKeys.CostValueModel);
if(editModel!=null)
e.Column.CellEditTemplate = editModel as DataTemplate;
if(cellmodel!=null)
e.Column.CellTemplate = cellmodel as DataTemplate;
}