C1FlexGrid adding extra quotations when saving as a text file

Posted by: mhamilton on 26 October 2021, 11:13 am EST

    • Post Options:
    • Link

    Posted 26 October 2021, 11:13 am EST

    I have an issue where I have a C1FlexGrid that contains a text string that starts with a quotation (") and when I save the grid to a file it adds extra quotations around the text. Saving as an excel file works correctly.

    Example

    The text in the C1FlexGrid is

    “As Received” Calibration

    Saving as a text file results in

    “”“As Received”" Calibration"

    I attached an example project.

    FlexGridWindowsFormsApp.zip

  • Posted 27 October 2021, 3:44 am EST

    Hi,

    I think this is the expected behavior, as “SaveGrid” creates a CSV file, and the quotation is required for CSV files. You will see this if you import the text file to excel.

    The only workarund would be to open the text file afterwards and replace all triple quotes by single quotes.

    Hope this helps

    Wolfgang

  • Posted 27 October 2021, 5:20 am EST

    Hi,

    As Wolfgang suggested, the grid creates a CSV with TAB as the column separator and the quotes are added around the string if it contains quotes.

    If you do not need this behavior then you can easily write your own Save method to save the cell text separated with TAB without any modfications. Please refer to the sample attached.

    Regards

    Avnish

    FlexGridWindowsFormsApp_mod.zip

  • Posted 27 October 2021, 10:33 am EST

    Thank you for the clarification and recommendations. I greatly appreciate the help and support!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels