What is the right way to set cell font family, font size and font style?

Posted by: jonathan.gross on 15 October 2018, 3:04 pm EST

    • Post Options:
    • Link

    Posted 15 October 2018, 3:04 pm EST

    There are fontFamily, fontSize, fontStyle and fontWeight methods - but all these apply only to comments, not the cell itself.

    If I want to control these parameters for cell separately - what is the right way to do so?

  • Posted 16 October 2018, 9:58 am EST

    Hello,

    You can set the style for cells, where it allows you set the font and other properties. For example:

    
    var style = new GC.Spread.Sheets.Style();
    style.font = "8pt Arial";
    style.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
    style.vAlign = GC.Spread.Sheets.VerticalAlign.center;
    activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport);
    activeSheet.getCell(1,1).value("B2");
    
    

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.Style.html

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels