Cell Editor Custom Style

Hello, I’m using the dhtmlxGrid and there are times when I need to override the style of an individual cell. So I will add the following to the XML: style=“font-weight: bold;font-family: Verdana;font-size:8pt;” This works great, but the problem is when I edit the cell, the edit text is in another style. How can I get the editor text style to match my overriden style? The same is true for combo cells. When the combo is dropped down on an overriden cell, the cell text is not the same font as the overriden style.


You may try to add the following css:

<style> .dhx_combo_select, .gridbox_dhx_skyblue .dhx_combo_edit, .gridbox_dhx_skyblue .dhx_textarea{ font-weight: bold; font-family: Verdana; font-size:8pt; } .dhx_textarea{ font-weight: bold; font-family: Verdana; font-size:8pt; } </style>

Thanks sematik. How would I do this at runtime? I am creating XML at runtime, so I can’t have a predefined CSS class when a certain cell is overriden. So if a cell needs to be overriden based on our business rules, I add the style to the XML.

Unfortunately it’s not available.

You can do this at runtime with jQuery:

myGrid.attachEvent(“onEditCell”, function (stage, rId, cInd, nValue, oValue) {
switch (stage) {

case 1: // cell editor activated and ready for input
var myAlign=myGrid.cells(rId,cInd).cell.getAttribute(‘align’); //Get Cell-Alignment
$(".dhx_combo_edit").css(“text-align”, myAlign); // assign the same alignment to the editor
// set other styles of interest


Thanks Andruscha, I’ll try that.

How to make combo readonly in dhtmlxgrid

combo.enableFilteingMode(true); //Like this

Please, try to use the readOnly() method of the dhtmlxCombo:
docs.dhtmlx.com/doku.php?id=dhtm … o_readonly