Jump to content


Photo

OnCellFormating not working


  • Please log in to reply
3 replies to this topic

#1 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 11 October 2015 - 10:21 PM

Hi Boki,

 

when OnCellFormating is used, working with the grid becomes impossible because cell coloring goes completely wrong (see example.png)

Attached is a little example with source (using VirtualTable component from Devart). Done with Delphi XE and NextDbGrid 5.9.60

 

Tried to use NextSuite v6 but there is no version for Delphi XE ... :(

 

best regards

 

Attached Files



#2 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 12 October 2015 - 08:31 PM

have found the reason:

 

in OnCellFormating i do a

...

value := nextGrid.Cells[0, aRow];​

if value < 0 then TextColor := clRed;

...

If i use a random value instead "nextGrid.Cells[0, aRow]" everything works okay.

 

Now i need only a solution...



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 12 October 2015 - 09:17 PM

Hi,

 

I suggest that you read current Field value, rather than going to the row.

 

Record is already positioned at this row so you only need to use NextDBGrid1.Columns[ColIndex].Field.AsInteger < ...

 

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

#4 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 13 October 2015 - 05:56 PM

Hello Boki,

 

this works!   :)

 

thank you very much






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users