I've got a simple RadGridView showing an ObservableCollection<> which is bound at run-time as the user can select which type to load. On the same grid I let my users dynamically create expression columns. All works fine and as expected excepting for the Export() function which doesn't seem to include any columns of type GridViewExpressionColumn.
This is how I create the columns at run-time:
var column =
new
GridViewExpressionColumn();
column.Expression = **some LINQ expression here**
column.UniqueName = field.Name;
var btnExpressionColumn =
new
RadButton();
column.Header = btnExpressionColumn;
btnExpressionColumn.Content = field.Name;
btnExpressionColumn.Click +=
new
RoutedEventHandler(btnExpressionColumn_Click);
gridView.Columns.Add(column);
And this is how I export the grid:
using
(Stream stream = dialog.OpenFile())
{
gridView.Export(stream,
new
GridViewCsvExportOptions()
{
Format = ExportFormat.Csv,
ShowColumnHeaders =
true
,
ShowColumnFooters =
true
,
ShowGroupFooters =
false
,
});
}
Please advise on how to solve this problem.
Thanks
8 Answers, 1 is accepted
This issue is known and has been fixed. It will be available either in our next internal build or our official Service pack release this year.
Regards,Nik
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Any temporary workarounds please?
The official service pack will be after two weeks. Unfortunately there are no workarounds for this issue.
Regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Any way to read the values of Expression cells please? I can iterate the ItemsSource collection myself but I need to get the values of the expression columns somehow.
The fix is available with our latest internal build from today - 2011.3.1205. You can download it from your account and give it a try.
Regards,
Hristo
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Is there any way to read the values of Expression cells? If I iterate the ItemsSource collection, how can I get the values from the Expression cells? Can you send me a sample app demonstrating that?
You can get the column from the column collection of the grid and use the GetValueForItem method.
var col =
gridView.Columns[
"Expression"
]
as
GridViewExpressionColumn;
var cellValue = col.GetValueForItem(Item);
Hope this helps!
Kind regards,
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
