我用了一个Tmysortlistview得控件,可实际运行不理想不是排序不正确就是单击出错不好用
想用代码自己写   大家多 指点!!

解决方案 »

  1.   

    试试这个,排序不理想自己完善下:function CustomSortProc(Item1, Item2: TListItem; lParam: LongInt): Integer; stdcall;
    begin
      if lParam >= 0 then //lParam中保存的是SubItem的Index
      begin
        result := -CompareText(Item2.SubItems.Strings[lParam], Item1.SubItems.Strings[lParam]);
      end
      else
        result := 0;
    endprocedure TSetRangeForm.ListView1ColumnClick(Sender: TObject;
      Column: TListColumn);
    begin
      TListView(Sender).CustomSort(@CustomSortProc, 0);
    end;