ListView修改单元格但要把字段写入库中,可能要写很多代码哦?! 好的解决办法是对没条记录进行操作,譬如点击某行时弹出窗口,然后操作该行 ListView.CustomSort()可以进行排序;procedure TfrmCenter.lvCenterColumnClick(Sender: TObject; Column: TListColumn); begin if ListView.Items.Count = 0 then Exit; intSortColumn := Column.Index; if ListView[intSortColumn] then ListView.CustomSort(@CustomSortDescProc, 0) else ListView.CustomSort(@CustomSortAscProc, 0); ListView[intSortColumn] := not ListView[intSortColumn]; end;
好的解决办法是对没条记录进行操作,譬如点击某行时弹出窗口,然后操作该行 ListView.CustomSort()可以进行排序;procedure TfrmCenter.lvCenterColumnClick(Sender: TObject;
Column: TListColumn);
begin
if ListView.Items.Count = 0 then Exit; intSortColumn := Column.Index; if ListView[intSortColumn] then
ListView.CustomSort(@CustomSortDescProc, 0)
else
ListView.CustomSort(@CustomSortAscProc, 0);
ListView[intSortColumn] := not ListView[intSortColumn];
end;