Create cell styling while adding new rows to flexgrid during exporting

Posted by: fullah on 12 October 2017, 1:33 pm EST

    • Post Options:
    • Link

    Posted 12 October 2017, 1:33 pm EST

    When I click button export to excel, at that time i add new rows to flexgrid and want to give style to each cell.

    refer to http://jsfiddle.net/farhatullah/p54xrtb7/24/ fiddle.

    My question is that how to give color price column and how to make it not bold?

    Thanks

  • Posted 13 October 2017, 5:27 am EST

    Hi,

    You need to use formatItem property of IFlexGridXlsxOptions for this. Please refer to the updted fiddle (http://jsfiddle.net/mkgupta911/p54xrtb7/25/) for the same.

    ~Manish

  • Posted 13 October 2017, 10:48 am EST

    HI Manish,

    Can we remove row from flexgrid like at line no 19 of java script file in above mentioned fiddle

    flexGrid.remove(1);

    How we can achieve this.

    Thanks

  • Posted 13 October 2017, 12:50 pm EST

    Hi Manish,

    In this http://jsfiddle.net/farhatullah/p54xrtb7/27/ fiddle, Actually i want to add some rows at the top of table grid data while exporting to excel. I am facing an error while adding cells.Because there are 3 cells of table and am adding new row to cellheader with 4 cells.Please tell me how to add separate rows to excel with out cellheaders.

    Thanks

  • Posted 16 October 2017, 3:49 am EST

    Hi,

    You can remove rows by getting instance of the row that you would like to delete.

    For Example:

    deleteRow() {
            let order = 5,
                c = {};    ;
            for (var j = 0; j< this.flex.rows.length - 1; j++) {
                if (this.flex.rows[j].dataItem.id == order) {
                     c = this.flex.rows[j];
                    break;
                }
            }
            this.flex.rows.remove(c);
        }
    
  • Posted 16 October 2017, 4:38 am EST

    Please see the fiddle for adding a new Row . Let me know if you face any issues

    http://jsfiddle.net/pxmsputh/

    Thanks,

    Abhishek

  • Posted 17 October 2017, 10:03 am EST

    Hi Manish,

    this is a https://i.imgur.com/xziJs0R.gif image link and there are two collection, collection1 and collection2 with different number of rows and columns.

    How can we merge these two collection and export to excel?

    This is http://jsfiddle.net/pxmsputh/3/ fiddle link.

  • Posted 19 October 2017, 9:31 am EST

    Hi Manish,

    Please provide your feedback against above query.

    Thanks

  • Posted 23 October 2017, 3:06 am EST

    Hi,

    As per the screenshot and sample, you need to merge the object using assign method of Object class.

    Please pick up one of the solution from given below

    You can add columns by checking existing column or you can re-assign updated collection view to FlexGrid’s itemsSource and set back to previous columnLayout before adding column or assigning itemsSource.

    Alternatively, you can assign updated collectionView to the newly created FlexGrid instance.

    Please refer to the updated fiddle(http://jsfiddle.net/pxmsputh/6/) for adding column solution.

    ~Manish

Need extra support?

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

Learn More

Forum Channels