This question is locked. New answers and comments are not allowed.
I have a RadGridView in Silverlight bound to a dynamic DataTable. My goal is to have a single complex object per column in the table and have the rows of the table bound to the properties of the object. I have built a DataTable where each cell for a given column will contain a refrence to the same object. Then I used the RowLoaded event to apply a custom ContentTemplate to the cell that binds to the correct property based on the row. I also found that the cell DataContext was the DynamicObject for the entire row, so I am also changing the DataContext of the cell to the object I want to bind to. All of this works fine until I try to edit the cell. The cell goes into edit mode, but the cell contents cannot be modified and then the cell never exists edit mode (see viewcells.jpg for before edit and editcells.jpg after edit).
Here is the RowLoaded event that I am using to replace the Cell.ContentTemplate. The templates are resources in the XAML.
Here is the RowLoaded event that I am using to replace the Cell.ContentTemplate. The templates are resources in the XAML.
private void RadGridView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e){ if (e.Row.DataContext is DynamicObject) { var cellObject = (e.Row.DataContext as DynamicObject); var rowName = cellObject.GetVal<String>("Description").AlphaOnly(); if (cellObject != null) { foreach (var cell in e.Row.Cells) { var column = (cell.Column as GridViewDataColumn); if (column != null && column.DataType == typeof(SelfSelectedYear)) { cell.DataContext = cellObject.GetVal<SelfSelectedYear>(column.UniqueName); cell.ContentTemplate = this.Resources[rowName + "CellTemplate"] as DataTemplate; } } } }}