Recent

Author Topic: DBGrid and OnDrawColumnCell  (Read 4903 times)

Meg

  • New member
  • *
  • Posts: 8
DBGrid and OnDrawColumnCell
« on: February 08, 2007, 04:30:38 am »
I try to write an event on "DBGrid-OnDrawColumnCell",
and it caused an error of "External:SIGSEGV",
when I use like,
"if COlumn.Field.DisplayName='CHIKU' then",
"if Column.Field.FieldName='CustNo' then" or
"if Column.FieldName='CHIKU' then".
When I use "if DataCol=1 then" is OK.
But these 4 lines are OK in delphi6.
anybody, any idea?

RudieD

  • Full Member
  • ***
  • Posts: 234
RE: DBGrid and OnDrawColumnCell
« Reply #1 on: February 08, 2007, 06:06:29 pm »
Just check if Assigned(Column) and Assigned(Column.Field) ?
The FRED Trainer. (Training FRED with Lazarus/FPC)

Meg

  • New member
  • *
  • Posts: 8
DBGrid and OnDrawColumnCell
« Reply #2 on: February 09, 2007, 01:59:40 am »
Thank you for your reply!
I just put "if Assigned(Column) then" before asking
"if Column.FieldName='CustNo' then", and
it works! Thanks!

 

TinyPortal © 2005-2018