Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 598
  • Last Modified:

inplace-editor of TDBGrid

I'm trying to write an enhanced version of TDBGrid, called TEDBGrid.  One of key features is that display a bitmap when Boolean field for True and another bitmap for False, and toggle it's value through space.  I can display bitmaps, toggle values by keypress successfully, but it will display the textual True or False before my drawing.  This is due to the inplace-edit object of the parent class, and this object is encapslated, so I can't access it directly.  Unfortunately, the inplace-editor is needed to commit my data change by emulate a Enter key.

So, my question is how to make the inplace-editor  respon to my key press and bypass the screen redraw?
0
alsan
Asked:
alsan
1 Solution
 
sperlingCommented:
If you need to access TInplaceEdit, you must override TCustomGrid.CreateEditor, and do something like this:

function TEDBGrid.CreateEditor: TInplaceEdit;
begin
  FAnotherPointerToEditor := inherited CreateEditor;
  Result := FAnotherPointerToEditor;
end;


You could ofcourse also create a descendant of TInplaceEdit in CreateEditor and return that, giving you all the control of the editor you need.


Regards, Erik.



0
 
alsanAuthor Commented:
Thanks a lot for your answer.  I'll try it as you say.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now