Вниз
Скачать: CL | DM;

Listview   Найти похожие ветки 

 
Maksss   (2003-06-25 13:47) [0]

как сделать сортировку в листвиеве не по первой колонке, а по второй и т.д.


 
Poirot ©   (2003-06-25 13:56) [1]

OnCompare + F1 - там всё описано!!!


 
dataMaster ©   (2003-06-25 13:58) [2]

function CustomStringSortProc(Item1, Item2: TListItem; ParamSort: integer): integer; stdcall;
begin
result:=0;
if ParamSort=0 then
if (Item1.Caption)>(Item2.Caption) then Result :=1 else
if (Item1.Caption)<(Item2.Caption) then Result :=-1 else
else
if (Item1.SubItems[ParamSort-1])>(Item2.SubItems[ParamSort-1]) then Result :=1 else
if (Item1.SubItems[ParamSort-1])<(Item2.SubItems[ParamSort-1]) then Result :=-1;
end;

Использовать:
ListView1.CustomSort(@CustomStringSortProc, ColumnIndex);


 
Maksss   (2003-06-25 14:37) [3]

пасибо



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.01 c
1-20080
maxon
2003-06-24 11:15
2003.07.07
ждать завершение процедуры


3-19976
Status_I
2003-06-12 12:34
2003.07.07
SQL-запрос к BD Paradox


3-19979
???
2003-06-12 23:11
2003.07.07
ADO выдаёт ошибки...


4-20356
BJValentine
2003-05-07 16:53
2003.07.07
CreateProcess


3-19971
tamara
2003-06-10 16:57
2003.07.07
MSSQL2000




   Наверх