arilotta Posted May 30, 2017 Share Posted May 30, 2017 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: http://forums.unigui.com/index.php?/topic/5111-hiding-focus-lines-in-tunidbgrid/ 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 Quote Link to comment Share on other sites More sharing options...
MarkLince Posted May 31, 2017 Share Posted May 31, 2017 Hi, I think this is more what you need http://forums.unigui.com/index.php?/topic/5675-change-the-color-of-selected-row-in-unidbgrid/?hl=ondrawcolumncell&do=findComment&comment=33135 Mark 1 Quote Link to comment Share on other sites More sharing options...
MarkLince Posted May 31, 2017 Share Posted May 31, 2017 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 1 Quote Link to comment Share on other sites More sharing options...
arilotta Posted June 1, 2017 Author Share Posted June 1, 2017 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... Quote Link to comment Share on other sites More sharing options...
MarkLince Posted June 1, 2017 Share Posted June 1, 2017 Hi, You are welcome, but the credit goes to others on here who helped me with this type of stuff! Regards Mark Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.