1

I'm trying to remove the row lines borders on the DBGrid. There is no property to change the DBGrid color directly, or to remove them. I tried, on the CustomDrawEvent, setting the canvas pen to psClear, but it did not work. I changed some properties in my DBGrid to make it look as the image below, like so:

Ctl3D: false
BorderStyle: bsSingle
DrawingStyle: gdsGradient

I want to remove these white borders

I also tried this to remove the lines by using the sabe color as the background, but the result was not what I wanted and ended up like this (I used red to represent the wrong result):

enter image description here

I am trying to achieve something like this (Notice how there is no line between the rows):

Is there a way so I can remove these lines between the rows?

Edit: You can remove the columns and rows lines completely using

DBGrid.Options.dbColLines = false
DBGrid.Options.dbRowLines = false

1 Answers1

0

Use these to remove the gridlines

DBGrid.Options.dbColLines := false;
DBGrid.Options.dbRowLines := false;

When you use the Jedi Vcl you can just use the TJvDBGRid and it’s event OnGetCellParams to change the cell colors by setting the value of the Background parameter.

Else you should use the OnDrawCell event to draw the text yourself using your own background color.

Or you can use the OnDrawColumnCell event.

R. Hoek
  • 916
  • 8
  • 27
  • I can't find the event OnGetCellParams on the TDBGrid on Delphi XE 10.2. The code to removed, as I put in the Edit of my question, worked – Matheus Neves Jul 17 '20 at 15:16
  • 1
    Oh, sorry my bad. I’ve using using the Jedi VCL TJvDBGrid for so long, I just gave this answer... – R. Hoek Jul 17 '20 at 20:22