列表视图问题 [英] Problem with list view

查看:87
本文介绍了列表视图问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在列表视图方面遇到了问题,任何人都可以帮助我吗?

问题是老板要求我创建一个搜索页面,搜索结果以列表视图项的样式显示在列表视图中.

然后他要求在listview附近的文本框上输入内容时,最好将其过滤在list view中.

我做了所有这些操作,但问题是当我键入过滤器时需要时间,而这次是
结果显示出现的延迟不被接受,我要做的是从有界列表中过滤
并将listview重新绑定到新的数据源.

解决此延迟的任何想法??

和thx表示全部.

Hi every one, I have a problem with list view, can any one help me??

the problem is that my boss ask me to make a search page, the search result appear in list view with a style for list view item.

and he ask to textbox near the listview to help hem filtring the result in the list view on typing the result most be filtred in the listview.

i did all of this but the problem is when i type the filter take time and this time and
this appeared delay of result show is not accepted, all i do is filter from bounded list
and rebind listview with the new datasource.

any idea to resolve this delay ??

and thx for all.

推荐答案

你好.

这取决于您如何过滤绑定列表.

我更喜欢使用linq.

例如:


Hello.

it depends on how you are filtering the bound list.

I prefer to use linq.

For example:


var foundPerson = from p in PersonEntity
              where p.Surname.StartsWith("sh")
              select p;

MyBoundList = foundPerson.ToList();




它比这快得多:




It''s very faster than this:

foreach (Person person in PersonEntity)
{
    if (person.Surname.StartsWith("sh"))
        MyBoundList.Add(person);
}


这篇关于列表视图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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