This is a migrated thread and some comments may be shown as answers.

RadGridView.Export() doesn't export columns of type GridViewExpressionColumn

8 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marcelo
Top achievements
Rank 1
Marcelo asked on 05 Dec 2011, 03:35 PM
Hi,

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

Sort by
0
Nick
Telerik team
answered on 05 Dec 2011, 04:12 PM
Hi Marcelo,

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 >>

0
Marcelo
Top achievements
Rank 1
answered on 05 Dec 2011, 04:18 PM
What's the ETA for the SP release?

Any temporary workarounds please?
0
Vlad
Telerik team
answered on 05 Dec 2011, 04:20 PM
Hello,

 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 >>

0
Marcelo
Top achievements
Rank 1
answered on 05 Dec 2011, 04:23 PM
In two weeks time you mean? So I should have it by Monday 19th December 2011?

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.
0
Hristo
Telerik team
answered on 05 Dec 2011, 10:23 PM
Hello Marcelo,

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 >>

0
Marcelo
Top achievements
Rank 1
answered on 06 Dec 2011, 10:32 AM
Thanks will give it a go.

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?
0
Accepted
Nick
Telerik team
answered on 06 Dec 2011, 12:54 PM
Hi Marcelo,

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 >>

0
Marcelo
Top achievements
Rank 1
answered on 06 Dec 2011, 01:05 PM
Yep that's exactly what I was looking for! Thanks!
Tags
GridView
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Nick
Telerik team
Marcelo
Top achievements
Rank 1
Vlad
Telerik team
Hristo
Telerik team
Share this question
or