Jump to content


Photo

OnGetCellColor (TNxReportGridView6)


  • Please log in to reply
8 replies to this topic

#1 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 25 January 2018 - 06:48 AM

Hello Boki,

 

I use OnGetCellColor to create a two colored grid like this,

procedure TfrmAvailable._ReportGridViewGetCellColor(Sender: TObject; ACol,
  ARow: Integer; var CellColor: TColor; State: TNxCellPaintingState);
begin
  if not (csSelected in State) then begin
    if (ARow mod 2 = 0) then begin
      CellColor := JukeboxDefs._ColorListboxBackGroundNext;
    end else ; // CellColor := JukeboxDefs._ColorListboxBackGround;
  end;
end;

That works fine if all rows are Showing. But when I use 'OnGetRowShowing' to hide some rows the colored order is messed up.

 

Can you create a new Event that will give the right Index in the Grid so the colored rows are right?

Hope you understand.

 

Regards,

Eduard.

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 27 January 2018 - 05:18 PM

Hi,

What do you think about having dedicated property for displaying OddRows in different colors?

Maybe like OddRowColor or similar?
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 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 28 January 2018 - 12:35 PM

That is also a possibility. Only use in event for me is color change. Or you can make a Page index event.

My only goal is to bypass this kind of color bars. See picture.

 

Edit: I was thinking that if you choose for a Page Index event you can do more with it. Future ready :)

 

rowcolor.jpg



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 28 January 2018 - 07:48 PM

Hi I will see what to do. Will try with own property. Many peoples ask for this event do add even/odd colors feature.
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.

#5 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 28 January 2018 - 08:43 PM

That's fine for me :)



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 02 February 2018 - 08:01 PM

Hi,

In february update there will be AlternatingRowColor property (combined with aoAlternateRowColors in AppearanceOptions) for this purpose.
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.

#7 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 03 February 2018 - 09:25 AM

Thanks. Will you also take a look at topic:

Column AutoEditing troubles

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 February 2018 - 08:05 PM

Hi,

When you have time try pre-release for February and new AlternatingRowColor property (paired with flag in AppearanceOptions property).

Probably need more polishing, but it's a good step I think.

I saw another topic. I will need time to focus on it.
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.

#9 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 08 February 2018 - 12:26 PM

Hi,

 

Installed latest version and seems to be working even with rows visible false. :)

Thank you.

 

And yes, take a look at other topic. :)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users