Jump to content

TUniDBGrid cell background override selection color.


rgreat

Recommended Posts

Set:

procedure TMain.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs);
begin
   Attribs.Color:=clBlue;
end;

Now you will not see current cell selection at all.

Which make whole usage of Attribs.Color property debatable.

Link to comment
Share on other sites

  • 5 weeks later...

Workaround (for default style):

add styles (3 for each background color):

.cellred {
  background-color: #ffe6e6; // Main color
}
.x-grid-item-over .cellred {
    background-color: color-mix(in srgb, #ffe6e6 33%, #ddd); // mix with hower color
}
.x-grid-item-selected .cellred {
    background-color: color-mix(in srgb, #ffe6e6 33%, #98c9ef); // mix with selected color
}

Set cell style:

procedure TFramePodhod.DBG1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn;
  Attribs: TUniCellAttribs);
begin
  if something then begin 
    Attribs.Style.Cls:='cellred';
  end;
end;

Result cell background is mixed color:

Clipboard03.thumb.jpg.5c137d9bcc6a211ebf3983cc394afdd2.jpg

 

  • Thanks 1
Link to comment
Share on other sites

×
×
  • Create New...