Jump to content

Change the color of selected row in UniDBGrid


Gabriel Fabrega

Recommended Posts

  • 2 weeks later...
  • 5 months later...
  • 2 weeks later...
  • 1 month later...

if values = 1 then

Attribs.Font.Color := clRed

else

Attribs.Font.Color := clYellow;

 

Apenas pinta a célula, quero pintar toda a linha. Como faço?

 

Hi,

 

UniDBGrid1 -> OnDrawColumnCell

procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol,
  ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs);
begin
  if Column.Field.DataSet.FieldByName('FieldName').AsString = 'Value' then
  begin
    Attribs.Color := clGreen
  end;
end;

Best regards.

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

Quem quiser zebrar UniDBGrid use esse código no onDrawColumnCell do 


    if Odd((Sender as TUniDBGrid).DataSource.DataSet.RecNo) then
      Attribs.Color:= clWhite
    else
      Attribs.Color:= $00F1F2F3; // leve cinza
 

  • Like 1
Link to comment
Share on other sites

  • 7 months later...
  • 7 months later...
On 1/18/2020 at 7:39 AM, delphixpart said:

Dear All,

Greetings!

Appreciate help on how to use [.x-grid-row-selected], I have tried in CustomCSS in serverModule but no luck.

What am I missing?

Thanks in Advance

 

 

 

On 8/26/2015 at 12:56 AM, Sherzod said:

Hi,

 

Try:


.x-grid-row-selected .x-grid-cell-inner {
  font-weight: bold;
  background-color:green;
}

Best regards.

Does not work too.

unigui1514+xe10.3.3

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
On 1/31/2020 at 4:25 PM, mehmet07 said:

unigui 1.90.0.1518  not work too. 

How we can solve this problem?

.DBG .x-grid-item-selected .x-grid-cell {
  font-weight: bold!important;
  background-color:blue!important;
}

 

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...