PRODUCTS » Quick Links

FEATURED PRODUCT

With one subscription at over 50% discount price, you receive all current and future TMS VCL products + updates + support for 2 years

License only 695 EUR See More

LOGIN

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

SEARCH

STAY IN TOUCH

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

 

LINKS

PRODUCTS » VCL COMPONENTS » TADVSTRINGGRID » EXAMPLE 37

TAdvStringGrid

Example 37 : sorting on selected fixed rows of choice

TAdvStringGrid

This is a small demo for 2 new features in TAdvStringGrid 2.0 First, it is now possible to define the fixed row from where column sorting is controlled. Secondly, vertical cell alignment can now be controlled per cell through the OnGetAlignment event hander.

To allow another row to trigger and show sorts of columns, set the new grid.SortSettings.Row property to the row of choice. Note that this must be a fixed row.

Further, the cell alignment in this sample is set by the following OnGetAlignment event handler:

procedure TForm1.AdvStringGrid1GetAlignment(Sender: TObject; ARow, ACol: Integer; var HAlign: TAlignment; var VAlign: TVAlignment);
begin
  if ARow > 1 then
  begin
    if odd(ARow) then
    else
      VAlign := vtaBottom;
    if odd(ACol) then
    else
      HAlign := taRightJustify;
  end;
end;


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

Copyright © 1995 - 2010 TMS Software v3.3