There is unfortunately no automatic way. However if you implement sorting manually you can distinct which header row was clicked by handling the OnHeaderSectionCellClick event (where you have access to all properties of the clicked header cell). Example:
Is it possible to publish TCustomElXTree.OnHeaderSectionClick sorting routine (as public method) that You using? I was looking in the source code and it's complicated (multisort etc.)
Yes I know but I need the all magic that the TCustomElXTree.OnHeaderSectionClick do before it's call FItems.FRoot.Sort(true); My idea was to use this like that:
void __fastcall TfoCalculationEngineTest::ElXTreeHeaderSectionCellClick(TElXCustomHeader *Sender, TElXHeaderSection *Section, TElXHeaderCell *Cell) { if(Cell->RowIndex == (Sender->RowCount-1))//only for last row { //I do something else (not sorting) } else if(Cell->RowIndex == (Sender->RowCount-2)) { //I do sort trying to imitate sort click
Comments
Best regards,
Grzegorz
Grzegorz
My idea was to use this like that:
void
__fastcall
TfoCalculationEngineTest::ElXTreeHeaderSectionCellClick(TElXCustomHeader
*Sender, TElXHeaderSection *Section, TElXHeaderCell *Cell)
{
if(Cell->RowIndex == (Sender->RowCount-1))//only for last row
{
//I do something else (not sorting)
}
else
if(Cell->RowIndex == (Sender->RowCount-2))
{
//I do sort trying to imitate sort click
TElXTree* pTElXTree = dynamic_cast<TElXTree*>(Section->Owner->Owner);
if(pTElXTree)
{
pTElXTree->OnHeaderSectionClick(Sender, Section);
}
}
}
Grzegorz