提高列表显示以显示数据的性能 [英] increase the performance of list vew to display data

查看:55
本文介绍了提高列表显示以显示数据的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,在此代码列表视图中需要花费更多的时间来显示所有数据,请告诉我该怎么做才能提高要显示的列表视图项的性能.

Hello, in this code list view take much more time to display all data, please tell me what should I do to increase the performance of list view item to display.

int length = Int32.Parse(numericUpDown2.Value.ToString());
            string temp;
             listView1.View = View.Details;
            listView1.Items.Clear();
            for (int i = 0; i> 999; i++)
            {
                temp = MakePassword1(length);
                Refresh();
                listView1.Items.Add(temp.ToString());
            }

推荐答案

仅当您的列表"视图试图容纳太多项目时,您才会遇到问题.我可以看到的唯一替代方法是使用虚拟模式.这样,您将不会在列表视图的实例中保留所有数据的副本.

请参阅参考资料以获得解释和代码示例: http://msdn.microsoft. com/en-us/library/system.windows.forms.listview.virtualmode.aspx [
You can only have problems if your List view is trying to hold too many items. The only alternative I can see is using the virtual mode. In this way, you will not keep a copy of all your data in the instance of your list view.

See for explanation and a code sample: http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.virtualmode.aspx[^].

—SA


这篇关于提高列表显示以显示数据的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆