DHTMLX Docs & Samples Explorer

setBgColor(value)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxgrid.js

sets the background color for the cell

  • value- (string) the color value.
    Can be specified as:
    • Predefined/Cross-browser color name
    • Hexadecimal color
mygrid.cells("row1",1).setBgColor('red');      // Predefined/Cross-browser color name
mygrid.cells("row1",3).setBgColor('#ff0000');  //Hexadecimal color

See also: getBgColor