我的ListView的数据量太大, 全部刷新,耗时太长
有没有办法, 只更新其中的数据改变了的Item====================================
e.g.
Items[Index]:=ImageIndex; //这一句导致全部刷新全部ListView
有没有办法, 只更新其中的数据改变了的Item====================================
e.g.
Items[Index]:=ImageIndex; //这一句导致全部刷新全部ListView
解决方案 »
- Inno Setup 中如何响应MouseOver事件?
- 关于NetQueryDisplayInformation问题?
- 代码中的事件指的是什么?
- PL/SQL中包怎么保存啊?
- Pipe有什么用途?
- 怎样判断分别连到服务端两个TServerSocket上的客户端来源于同一台远端电脑?
- 本号码最后过期倒记时。。。散分啦!!!!!!!!!!!!!!!!!!!!!!!
- 程序运行时为何总要输入用户名和密码?请大家赐教
- 有关TACMConvertor这个控件的问题
- 在MDIform中可以以MDIChild形式调用另一个Form,但是如何将MDIChild关闭?
- 常见小问题,在线等!!!!
- 菜鸟求助:Query1.SQL.Add('INSERT INTO temp(ss,sum)');这句话有什么问题?(在线等待!!!)
Items[Index]:=ImageIndex;
items.endupdate;
ListView.Items.BeginUpdate
D.ImageIndex:=3
ListView.Items.EndUpdate;结果系统认为
ListView.Items.BeginUpdate
A.ImageIndex:=0
B.ImageIndex:=0
C.ImageIndex:=0
D.ImageIndex:=3
ListView.Items.EndUpdate;而导致系统刷新A B C D 四个Item
我只想刷新D, 有何办法
救命a~~~
}
//上面是猛料的
/////////////////////////////////////////////事例:1。 listview的ownerdata为true;2。
procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem);
begin
item.caption:='0';
item.SubItems.Add('1');
item.SubItems.Add('2');
item.SubItems.Add('3');
end;
3。
procedure TForm1.FormCreate(Sender: TObject);
begin
ListView1.Columns.Clear;
ListView1.Columns.Add.Caption := 'A';
ListView1.Columns.Add.Caption := 'B';
ListView1.Columns.Add.Caption := 'C';
ListView1.Columns.Add.Caption := 'D';
ListView1.items.count:=10;//控制总数
end;
/////////////////////////////////
你可以举一反三
程序中需要写保存数据的全局数组或者类,在ListView1Data 中读入并加入到Item上