Insert New Column FlexSheet

Posted by: oskarputraa on 23 August 2019, 9:05 pm EST

  • Posted 23 August 2019, 9:05 pm EST - Updated 3 October 2022, 7:32 pm EST

    Hi,

    Like i’ve posted here before https://www.grapecity.com/forums/wijmo/detect-new-column-#original-post

    I’ve found another issue, when I create new column, it named to “col1” right ? then I save it to database, quit my FlexSheet, then reloading the data from database, it appear new column “_item Idx”. Why it is appear instead of my new column “col1” ?

    Could you help me with that ? Thanks.

    Oskar Putra

  • Posted 26 August 2019, 2:55 am EST

    Hi Oskar,

    The “_item idx” is not actually “col1”, but instead it is a column generated automatically when you load the itemsSource from the database. This column is generated because you must be saving the data to the database by converting the itemsSource of the Sheet to a JSON string and storing it.

    Each dataItem in the FlexSheet has a property “_item Idx” that contains the index of that item and since you are generating the columns automatically after loading, the FlexSheet creates a column named “_item Idx”.

    To avoid this issue, you will also need to save the columnLayout of the FlexSheet to the database and set it again when the data source is loaded.

    Please refer to the sample below that demonstrates the same:

    https://stackblitz.com/edit/angular-skmeyn

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels