PRODUCTS

FEATURED PRODUCT

Create modern-looking & feature-rich applications with over 280 components including award-winning grids, scheduling components, Office 2007/2003 ribbon & toolbars, calendars, application update and much more...

License only 175 EUR See More

SEARCH

LOGIN

Customer login to access products, support information & special benefits.

NEWS ALERTS

Add your e-mail address here to receive the monthly TMS Software alerts.

 

LINKS

EXAMPLE 53

TAdvStringGrid

example 53 : inplace memo and popup memo editor As it was much requested to have a cell inplace editor that has vertical and horizontal scrollbars, this sample application shows how the MemoEditLink component can be used to attach a TMemo control as inplace editor in TAdvStringGrid. For more in detail information on how to use custom inplace editors in TAdvStringGrid, we refer to the discussion of sample application 24.

The TMemoEditLink component that is included default with TAdvStringGrid has 2 styles : EditStyle = esPopup and EditStyle = esInplace. The effect of these choices is obvious and can be see here: TAdvStringGrid

As the TMemoEditLink is ready and available, it is just a matter of using these in TAdvStringGrid.This is done by dropping 2 instances of TMemoEditLink on the form, set the EditStyle to esPopup for one TMemoEditLink and set it to esInplace for the other TMemoEditLink. TAdvStringGrid is told to use these custom editors with

procedure TForm1.AdvStringGrid1GetEditorType(Sender: TObject; ACol, ARow: Integer; var AEditor: TEditorType);
begin
  AEditor := edCustom;
  if ARow <> 2 then
   AdvStringGrid1.EditLink := MemoEditLink1
  else
   AdvStringGrid1.EditLink := MemoEditLink2
end;

So, with dropping the right components on the form and writing just a few lines of code, an inplace memo editor can be used that features scrollbars.

Delphi project & source files for downloading included in the main demos distribution for Delphi.

The project and source files have been written with Delphi 6,7. To use these files in other versions of Delphi, ignore any remarks when opening the form files and save the files. After this, compilation can be done. The error messages are due to properties included in the Delphi 6 form file, but not available in lower versions of Delphi.  

Copyright © 1995 - 2008 TMS Software