Jump to content


Photo

Nextgrid5 to Nextgrid6


  • Please log in to reply
2 replies to this topic

#1 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 07 March 2019 - 01:35 AM

Hi Boki,

 

I have a nextrgrid5 where I handle CellColoringEvent(Sender: TObject; ACol,
    ARow: Integer; var CellColor, GridColor: TColor; CellState: TCellState); to change the CellColor. I did this according to level of the Row.

 

procedure TFrmReport.gridReportCellColoring(Sender: TObject; ACol, ARow: Integer; var CellColor, GridColor: TColor; CellState: TCellState);
begin

    if not (csSelected in CellState) then
    begin
        if ARow = gridReport.RowCount -1  then
        begin
            CellColor := $0080FFFF;
        end
        else if (ARow < gridReport.RowCount-1) and (gridReport.GetLevel(ARow) = 0) then

                CellColor := $00FFAAAA
            else
                CellColor := $00FFAA77;

    end;
end;

I can't figure out how to do this in Nextgrid6. Your help is welcome.

 

I have found an event DrawBackGround but it looks like I have to draw the cell by myself. Is there a function that I can call to draw the default cell or provide it a background color?

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 07 March 2019 - 10:14 PM

Hi,

 

You can use OnGetCellColor event of view (Report or Slide view). You can select view and in ObjectInspector, in events tab you will see OnGetColor event.

 

There is a parameter TNxCellPaintingState who is defined in NxTypes6 unit.

 

Hope that this helps.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 18 March 2019 - 02:21 AM

Thanks Boki. The OnGetCellColor of Report works perfectly.

 

I have another issue with the Increment Column but I will create another post.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users