tags:

views:

146

answers:

2

Whats the minimum I have to do to descend a new control from TCustomGrid, and get it on a form in the IDE without getting 'Abstract Error' within the IDE?

I have tried everything for days, but Im a bit of a delphi noob atm, zero percent success with TCustomGrid :(

If someone could help me out just getting a basic descendant of TCustomGrid which does nothing but implement the base TCustomGrid behavious it would be much a appreciated. Thanks.

Edit - I know how to do the basics of creating controls, I just cant do it with TCustomGrid

+5  A: 

"Abstract Error" usually means that there are virtual abstract functions you'll have to implement to make the class work. For TCustomGrid, this should be the DrawCell method, as you can see here.

For a complete detailed example on how to build an own grid based on TCustomGrid, see this tutorial.

schnaader
Woot! TyTyTy - its working - i was trying to overide DrawCell in published not protected. Thanks for that code example link.
csharpdefector
You're welcome :)
schnaader
A: 

You only get abstract errors if you neglect to override and provide an implementation for a method that was declared virtual abstract in either TCustomGrid or any of its ancestors.

So the solution would be to find all of these (use ctrl-click on the class names to get from ancestor to ancestor) and provide an override. Start with an empty implementation of your overrides. That may cause other errors and broken/unexpected behaviour, but should get you past the abstract errors.

Marjan Venema