Page 1 of 1

Access current row/columns cells

Posted: Fri Feb 10, 2017 8:42 am
by 16880060
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.

Re: Access current row/columns cells

Posted: Tue Feb 14, 2017 8:57 am
by David
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

Re: Access current row/columns cells

Posted: Tue Feb 14, 2017 9:53 am
by David
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