Access current row/columns cells

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
oflor
Newbie
Newbie
Posts: 4
Joined: Mon Feb 06, 2017 12:00 am

Access current row/columns cells

Post by oflor » Fri Feb 10, 2017 8:42 am

I want to implement a order by column feature.

I want to use the OnClickHeader event to do so, but I don't find a method to know these values or the column number of the header I was clicked to.

David Berneda
Site Admin
Site Admin
Posts: 83
Joined: Wed Nov 12, 2003 5:00 am
Location: Girona, Catalonia
Contact:

Re: Access current row/columns cells

Post by David Berneda » Tue Feb 14, 2017 8:57 am

The "Sender" parameter in the OnClickedHeader event is the column that is under the mouse xy position, you can use it to determine the column index, name etc.

For example:

Code: Select all

procedure TFormGridCharts.TeeGrid1ClickedHeader(Sender: TObject);
begin
  Caption:=Sender.ClassName;

  if Sender is TColumn then
     Caption:=Caption+' '+TColumn(Sender).Header.Text+' '+IntToStr(TColumn(Sender).Index);
end;
BUT, I've just found a bug in the code, the OnClickedHeader event is never called.
I'll post asap a "nightly build" with a fix for this issue.

btw: Custom "order by column" (clicking header) will be also included in the "nightly build".

The following demo project shows how to use custom sorting:

https://github.com/Steema/TeeGrid/tree/ ... %20Sorting

David Berneda
Site Admin
Site Admin
Posts: 83
Joined: Wed Nov 12, 2003 5:00 am
Location: Girona, Catalonia
Contact:

Re: Access current row/columns cells

Post by David Berneda » Tue Feb 14, 2017 9:53 am

New beta v1.01 release, and a new example showing how to use "custom sorting"

https://github.com/Steema/TeeGrid/tree/ ... %20Sorting

Nightly build:
http://www.steebi.com/files/code/beta/vcl_fmx/teegrid/


regards !
david

Post Reply