GridView ExportCommand

5 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 10 Aug Link to this post

    Hi,

    i use a RadView with an ItemSource ViewModel and several RadGridViewColumns. Also i created a Button bound to the ExportCommand which works fine.
    The performance is not very well, but ok. My questions: Is it possible to export only defined Columns and not all out of the GridView? The Problem is, that i have about 20 Columns and in the pdf is looks like a mass.

     

    Thanks

    Best regards

    Rene

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 10 Aug Link to this post

    Hello Rene,

    Please have a look at the following article - How to Disable the Export of a Particular Column - which shows how to achieve the behavior when using the ExportToXlsx and ExportToPdf methods. 

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 23 Oct in reply to Stefan Nenchev Link to this post

    Hi,

    thanks helped a lot, but how can i export some empty columns which are not in the GridView?

     

    Thanks

    Rene

  5. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 23 Oct in reply to ITA Link to this post

    Hi,

     

    solved, but one last Questions. How do i add some GrindLines to the exported pdf? I Use the "GridLinesVisibility="Both""
    Property in my GridView, but on my Document they are not visible?!

     

    Thanks

    Rene

  6. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 24 Oct Link to this post

    Hi,

    Please check the following article - Style Exported XLSX & PDF documents. You can apply the following, in order to set borders to the exported cells:

    private void clubsGrid_ElementExportingToDocument(object sender, GridViewElementExportingToDocumentEventArgs e)
          {
              if (e.Element == ExportElement.Cell)
              {
                  (e.VisualParameters as GridViewDocumentVisualExportParameters).Style = new Telerik.Windows.Controls.GridView.CellSelectionStyle()
                  {
                      CellBorders = CellBorders.CreateOutline(new CellBorder(CellBorderStyle.Medium, new ThemableColor(Colors.Black))),
                      ForeColor = new ThemableColor(Colors.Green),
                  };
              }
          }


    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top
UI for WPF is Visual Studio 2017 Ready