Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting columns

Status
Not open for further replies.

nicasa

Programmer
Feb 3, 2003
54
ES
I am using this code to try to sort the data in the columns of my Listview object:-

void __fastcall TForm2::ListView1ColumnClick(TObject *Sender, TListColumn *Column)
{
ColumnToSort = Column->Index;
((TCustomListView *)Sender)->AlphaSort();
}

ColumnToSort is global and the viewstyle property is 'vsReport'. NOTHING happens when I click, right or left with the mouse !!

What am I doing wrong and what is the role of 'TListColumn *Column' in the function declaration ?
 
Try saying ((TListView*)Sender) instead of ((TCustomListView*)Sender).

You might have to refresh or repaint it afterwards too.

I would also set a breakpoint on that event and make sure it is getting called (make sure it doesn't have to be enabled or something).

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top