Export use Bound Column Field instead of Column Display Name

5 posts, 0 answers
  1. Mark
    Mark avatar
    130 posts
    Member since:
    Oct 2014

    Posted 31 Aug Link to this post

    We need the ability to use the underline field for each column instead of the column display name as the field in the export file.  Our column display names are built dynamically and it is possible that we can have two columns display names being the same. Their underline properties will be the different, therefore, we want to use that in the export.  

     

    Any help would be great.

     

    Thanks

  2. Mark
    Mark avatar
    130 posts
    Member since:
    Oct 2014

    Posted 31 Aug in reply to Mark Link to this post

    I hit send before I could fix the TITLE.  I need it for the COLUMN NAMES in the Export files.  

    Sorry

     

  3. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3988 posts

    Posted 02 Sep Link to this post

    Hello, Mark,

    One possible solution that I can suggest is to change the header text of the columns just before executing the export action and restore the column names afterwards.

    An alternative approach, in case you are using the GridViewSpreadExport which utilizes our RadSpreadProcessing library to export the content of RadGridView to xlsx, csv, pdf and txt formats, is to handle the ExportCompleted event which is triggered when the export operation completes. Once you have the exported grid data, you can benefit from the RadSpreadProcessing library, load the Excel file and change the columns names in the workbook:
    https://docs.telerik.com/devtools/winforms/controls/gridview/exporting-data/spread-export 
    https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks 
    https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-cells/accessing-cells-of-worksheet 

    Feel free to use this approach which suits your requirements best.

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  4. Mark
    Mark avatar
    130 posts
    Member since:
    Oct 2014

    Posted 03 Sep in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Yea, that's what I was afraid of.  I have a solution that is similar to that. While not ideal, it is working.   I was looking at the code and I don't see this being a huge change to the EXPORT feature.  Have a property that let's the user specify what to use for the column headers of the export file, either the Display Name or Field Name.  IMO, using the Display Name in a CSV export, is bad, for this exact reason, the possibility of having duplicate names in the Display Names of the columns.

    Thanks for the help and have a great day.

  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3988 posts

    Posted 04 Sep Link to this post

    Hello, Mark,

    Thank you for the provided feedback.

    We will definitely consider it in the future improvement of the export functionality that RadGridView offers if other customers have similar requests.

    Should you have further questions please let me know.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top