我有一个像这样的价值守护者
Key | Name |
---------------|
Car | Audi |
Nick | Yummi |
Age | 70 |我想修改第二行中的"Nick“键,并保留"Yummi”的名字。
我不想重写整行。
我只想把“尼克”改成“昵称”。
我怎么能在一次罢工中做到这一点?
发布于 2014-02-19 23:01:21
找到要更改的行,然后更新适当的Cell
var
iRow: Integer;
begin
// Find the row containing 'Nick' as the key
ValueListEditor1.FindRow('Nick', iRow);
// If it was found, update the key value (column 0 of the row)
if iRow > -1 then
ValueListEditor1.Cells[0, iRow] := 'NewNick';
end;注意,TValueListEditor.Cells是基于0的,其中列是Keys (列0)和Values (列1)。
https://stackoverflow.com/questions/21893998
复制相似问题