This question is locked. New answers and comments are not allowed.
It seems since upgrading to a newer set of Q2 dlls (RadControls_for_Silverlight_4_2011_1_0419_Dev_hotfix or beyond - and the same also happens in Q3) we are getting errors with our grid extract.
When a null value is hit, we get an error. I can see why from our code (null reference), however even after handling this, the extract succeeds but simply has [#Error] in all of the cells (Excel).
We are using extract differently in another area in the app and it does not seem to have been impacted.
Offending Code:
Even if we handle the exception (check for null e.Value and return) then then output is bad ([#Error] in every cell that is not null) - the attached file output shows this.
When a null value is hit, we get an error. I can see why from our code (null reference), however even after handling this, the extract succeeds but simply has [#Error] in all of the cells (Excel).
We are using extract differently in another area in the app and it does not seem to have been impacted.
Offending Code:
private static void radResult_ElementExporting(object sender, GridViewElementExportingEventArgs e) { if (e.Element == ExportElement.Cell) { var column = e.Context as GridViewDataColumn; if (column == null) return; Binding binding = column.DataMemberBinding; if (binding == null) return; IValueConverter converter = binding.Converter; if (converter == null) return; object value = e.Value; Type type = e.Value.GetType(); // <== this suddenly started throwing errors after update object parameter = binding.ConverterParameter; CultureInfo culture = binding.ConverterCulture; e.Value = binding.Converter.Convert(value, type, parameter, culture); } }Even if we handle the exception (check for null e.Value and return) then then output is bad ([#Error] in every cell that is not null) - the attached file output shows this.