Jump to content


Photo

NextDBGrid6: Row color prob. using GridView's OnGetCellColor

OnGetCellColor

  • Please log in to reply
14 replies to this topic

#1 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 17 May 2017 - 04:53 PM

Howdy,

 

  To begin, I'm using Delphi 7, Absolute DB & NextGrid6 (in process of upgrading from Next Suite 5 - to - 6). 

 

  I have a NextDBGrid6 in which I wish to have selective row coloring.  Basically, I wish to have a row displayed 

in a certain color (red) based on a row's data value, otherwise I'd like to have all rows displayed in an alternating 

light & dark color.  The desired order of priority for a row's color would be:

  - if selected, use standard selection color (default is blue, I believe)

  - if not selected & a data condition is present, use desired color (red)

  - if not selected & data condition is not present, display rows is alternating light & dark colors

 

  I'm attempting to implement the above via the grid's view using the view's OnGetCellColor event.

The initial display for all rows I'm receiving is the middle condition mentioned above (all rows in red).

 

  For ref, I had the above logic operating with ver. 5 (NextDBGrid) via use of the grid's OnCellColoring event.

 

  I've attached a screen shot with both the code used in the view's OnGetCellColor event, the app's results 

and an alt. view.

 

  Any ideas \ thoughts \ corrections on how I can alter the OnGetCellColor event logic to correct this prob?  

Or should I be using some other event (either in the dbgrid or it's view)?

 

                                 Thanks,

 

  For ref, I had the above logic operating with ver. 5 (NextDBGrid) via use of the grid's OnCellColoring event.

 

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 17 May 2017 - 07:03 PM

Hi,

Probably is my bug. But your query result probably make a difference.

Can you tell me do you just run query and get result (AsBoolea) or you loop trough query and similar?

I will inspect something in meanwhile
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 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 18 May 2017 - 03:06 PM

Howdy Boki,

 

  Thanks for the rapid reply!  

 

  Your question 'Can you tell me do you just run query and

get result (AsBoolean) or you loop trough query and similar?'  

 

  To answer: This results I'm receiving are from running a query 

(to initially fill the NextDBGrid6).  

 

 



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 May 2017 - 04:40 PM

Hi,

I think I find the problem, it's in csSelected checking. I will try why it always give True.

I will work on it next couple of days.
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 May 2017 - 08:29 PM

Hi,

Can you also try to set DisableControls/EnableControls when you run query? Grid is looping trough records and maybe disabling db controls (such as my grid) is good idea.
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.

#6 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 22 May 2017 - 04:11 PM

Howdy Boki,

 

  Thanks for the research & suggestion.

 

  I'm already issuing a Query.DisableControls before executing my queries & issuing a Query.EnableControls afterwards.  

I agree: disabling the DB controls is always a good idea.  Unfortunately, this isn't solving this current problem ...

 

  When you have a fix: if you'd like to send me (DbBanjo@Yahoo.Com) a code update, I can certainly test & report the 

results to you.

 

                    Thanks for your help,

 

 

 



#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 May 2017 - 06:23 PM

Hi,

If is possible, can you send me a mini demo project with simplified query function you use.

It will help a lot!
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.

#8 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 22 May 2017 - 08:30 PM

Howdy Boki,

 

  Hmm, the problem is the data I'm using is all live financial data.  

Let me see if I can create some dummy data to use for your testing & 

then create a small, temp app. for you.

 

  Question: I'm using Absolute DB, Ver 7.1: do you have the ability 

to test with this type of data?

 

 



#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 May 2017 - 09:09 PM

Yes, some dummy data several records will be fine.

Do you maybe know to work with ClientDataSet? I can send you demo project I created working on this bug and you can modify it so the bug is exposed.
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.

#10 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 23 May 2017 - 02:02 AM

Howdy Boki,

 

  Sure, I can test out your demo using a ClientDataSet backend.  Just email to DbBanjo@Yahoo.Com

(.Zip format is probably best for your email attachment).

 

  In the morning, when I get back into the office, I'll work creating a small demo with my Absolute DB backend & 

then I'll email to you.

 

                 Thanks for all of your help so far,

 

                          Marc Bolen

 

 

 



#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 23 May 2017 - 07:29 AM

Hi Marc,

Here is attached ClientDataSet demo.

Attached File  cds.zip   57.45KB   3 downloads
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.

#12 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 23 May 2017 - 10:54 AM

Howdy Boki,

 

  I had a bit of free time before work this morning, so 

attached is a .zip with a slight rework of your ClientDataSet demo.  

 

 The attached was altered from your original for Delphi 7 & 

I also included the .Exe (sorry for the large .Zip size due to 

this fact - just trying to save you a bit of time).

 

 The attached should clearly demonstrate the problem I'm

attempting to outline.

 

              Thanks for your help & patience so far,

 

 

Attached Files



#13 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 24 May 2017 - 12:58 AM

Howdy Boki,

 

  Hopefully my version of the small, CDS demo can show you 

the problem I'm trying to explain.  

 

              Thanks,



#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 27 May 2017 - 12:17 PM

Hi,

Thank you for your demo, it helped me.

Unfortunately I will need some time to solve the problem. It's serious bug and I will work 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.

#15 DbBanjo

DbBanjo
  • Members
  • 26 posts

Posted 27 May 2017 - 02:52 PM

Morning Boki,

 

  Totally understood.

 

  Thanks for your patience & time.  

Also, thanks for your hard work on 

a great product!






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users