开发者

filter binding source or bindinglist with textbox_keypress

I use winforms and c#.

How can I filter Binding source or binding list. with a textbox text ? I meam while I am typing in a textbox my grid is filtering wi开发者_开发技巧th a %Like method not (=,equal)method.

thanks.


I use delegate for this problem. Some code like bellow

        _List = _List.FindAll(
            delegate(MyEntity entity)
            {
                return entity.Title.Contains(TXT_Title.Text);
            }
        );
        Gview.DataSource = _List  ;


You may want to use CollectionViewSource class to enable filtering.

See here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜