How to make flexsheet cell content right aligned?

Posted by: chayankar209 on 29 May 2018, 6:28 pm EST

    • Post Options:
    • Link

    Posted 29 May 2018, 6:28 pm EST

    How to make flexsheet cell content right aligned ? Right now it is left aligned (by default)

  • Posted 30 May 2018, 2:36 pm EST

    Hi,

    By default, the FlexSheet columns are auto aligned based on DataType in bound sheet.

    However, you may set alignment for column by setting align property.

    flexSheet.columns.forEach((item)=>{
          item.align="right";
        });
    

    In case, you would like to align right only certain cells, you need to use applyCellsStyle method.

     flex.applyCellsStyle({
            color:'green',        
            textAlign:'right'
          },[new wjcGrid.CellRange(6,0,11,1)]);
    flex.invalidate();
    

    ~Manish

  • Posted 31 May 2018, 4:23 pm EST

    Okay. Thank you !! Can you tell me the difference between bounded & unbounded sheet ?

  • Posted 31 May 2018, 10:38 pm EST

    Hi,

    A bound sheet is the one with some data bound to it i.e. its itemsSource is set to some collection where Unbound sheet has its itemsSource undefined.

    Also, for the boundSheet the data can be get once using itemsSource/CollectionView. While for unboundsheet, you need to get the data cell by cell using getCellData method.

    ~Manish

Need extra support?

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

Learn More

Forum Channels