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

9 posts, 1 answers
  1. Marcelo
    Marcelo avatar
    24 posts
    Member since:
    Oct 2010

    Posted 05 Dec 2011 Link to this post

    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

  2. Nik
    Admin
    Nik avatar
    513 posts
    Member since:
    Jul 2013

    Posted 05 Dec 2011 Link to this post

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

  3. Download a free trial of UI for WPF
  4. Marcelo
    Marcelo avatar
    24 posts
    Member since:
    Oct 2010

    Posted 05 Dec 2011 Link to this post

    What's the ETA for the SP release?

    Any temporary workarounds please?

  5. Vlad
    Admin
    Vlad avatar
    11043 posts
    Member since:
    Sep 2012

    Posted 05 Dec 2011 Link to this post

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

  6. Marcelo
    Marcelo avatar
    24 posts
    Member since:
    Oct 2010

    Posted 05 Dec 2011 Link to this post

    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.

  7. Hristo
    Admin
    Hristo avatar
    405 posts
    Member since:
    Sep 2012

    Posted 05 Dec 2011 Link to this post

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

  8. Marcelo
    Marcelo avatar
    24 posts
    Member since:
    Oct 2010

    Posted 06 Dec 2011 Link to this post

    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?

  9. Answer
    Nik
    Admin
    Nik avatar
    513 posts
    Member since:
    Jul 2013

    Posted 06 Dec 2011 Link to this post

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

  10. Marcelo
    Marcelo avatar
    24 posts
    Member since:
    Oct 2010

    Posted 06 Dec 2011 Link to this post

    Yep that's exactly what I was looking for! Thanks!

Back to Top
Download a free trial of UI for WPF