I'm running into a very odd problem that I am finding impossible to debug. I use customized column autogeneration of the RadGridView. Basically, on binding, it looks at each object that it is bound to and customizes the column based on attribute metadata decorating each property of the bound object. This all works fine.
In the app, I have a ComboBox which when a different item is selected, it changes the data source of the grid, clears the columns, and toggles the autogenerate property of the grid so that it generates columns based on the new data source. This code looks like this:
private async void Grid_OnDataLoading(object sender, GridViewDataLoadingEventArgs e)
{
var grid = (RadGridView)sender;
if (grid.AutoGenerateColumns != true) return;
grid.Columns.RemoveItems(grid.Columns.Cast<GridViewColumn>().Where(c => c.GetType() != typeof(GridViewToggleRowDetailsColumn)).ToArray());
grid.AutoGenerateColumns = false;
grid.AutoGenerateColumns = true; //Throws here
}
This code works normally when the app first loads. It only throws when the ComboBox is toggled and the grid's source is changed. Even more bizarre, it used to work fine in all situations, but at some point some change was introduced to the codebase somewhere which is now producing a bizarre error.
On the call to grid.AutoGenerateColumns = true, it is now throwing an exception, saying "No target found for method AutoGeneratingColumn". And it is Calburn Micro throwing this error, which I have no idea why this would it would even be involved in this process.
Any advice on how to debug this further would be really appreciated, as I've spent a lot of time on it and am at a total loss. Thanks.