Jump to content

DbGrid selected cell color


arilotta

Recommended Posts

Hi,

I'm using the UniDBGrid OnDrawColumnCell event to colorize cells background

according to a query field value.

I've hidden the selection as explained in this post:

 


 

Therefore, I added these lines to the CustomCSS property:

 

.x-grid-row .x-grid-cell-selected {

  background-color: #FFFFFF !important;

}

.x-panel .x-grid-body {

    border-width: 0

}

 

 

Now, the problem is that when the user selects a cell with a custom background color defined 

in the OnDrawColumnCell event, that color is replaced by the selection color, in my case by 

color white.

Is there a way to have the selected cell use the background color defined in OnDrawColumnCell event ?

 

Thanks

Andrea

 

Link to comment
Share on other sites

Hi,

Also This doesn't hide the selection it just adds custom color to cell/row selected and sets a border width of 0 to the grid body.

.x-grid-row .x-grid-cell-selected {
  background-color: #FFFFFF !important;
}
.x-panel .x-grid-body {
    border-width: 0
}

To hide / prevent grid selection;

 

uniguigrid-->clientevents-->unievents

function beforeInit(sender, config)
{
  sender.disableSelection = true;
}

Mark

  • Upvote 1
Link to comment
Share on other sites

Thank you very much Mark, the "disableSelection" property is exactly the solution I was looking for.

 

I was using the CSS just because I was unaware of the existence of that property...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...