我一般都是用Listview作显示用,修改时都是在Edit中进行
procedure TForm1.ListView1Click(Sender: TObject);
begin
if ListView1.Selected <> nil then
begin
Edit1.Text := ListView1.Selected.Caption;
Edit2.Text := ListView1.Selected.SubItems[0];
Edit3.Text := ListView1.Selected.SubItems[1];
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
//若你要一次修改多个数据,就将ListView1.Selected改成ListView1.Items[Index]即可,是那一行,看你怎么取Index值
if ListView1.Selected <> nil then
begin
ListView1.Selected.Caption := Edit1.Text;
ListView1.Selected.SubItems[0] := Edit2.Text;
ListView1.Selected.SubItems[1] := Edit3.Text;
end;
end;