Update Font Settings From Client Side

Contents
[ ]

Aspose.Cells GridWeb now supports changing font settings from the client side. For this, the API provides the following functions

  • updateCellFontStyle: Params - r/i/b/ib for regular/italic/bold/italic&&bold
  • updateCellFontSize: Params - fontname, etc. ‘System’
  • updateCellFontName: Params - fontsize,etc. ‘12pt’
  • updateCellFontColor: Params - none/u/l/ul/ for none/underline/strikout/underline&&strikout
  • updateCellFontLine: Params - html color like #aa22ee or wellknown color name like green,red,…
  • updateCellBackGroundColor: Params - html color like #aa22ee or wellknown color name like green,red,…

The following code snippet demonstrates changing font settings from client side in GridWeb.

Sample Code

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
<script>
function makeFontItalic(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontStyle, "i");
}
function makeFontBold(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontStyle, "b");
}
function changeFontSize(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontSize, "5pt");
}
function changeFontFamily(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontName, "Corbel Light");
}
function changeFontColor(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontColor, "green");
}
function changeFontBackgroundColor(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellBackGroundColor, "yellow");
}
</script>