开发者

Remove the blank item from ListBox

开发者 https://www.devze.com 2022-12-28 08:50 出处:网络
The ListBox/Dropdown list use a external datasource(sharepoint list) as a datasource to popula开发者_StackOverflowte the items. But there is one problem, the first item is a blank item, can we remove

The ListBox/Dropdown list use a external datasource(sharepoint list) as a datasource to popula开发者_StackOverflowte the items. But there is one problem, the first item is a blank item, can we remove it?

Best Regards,


I have solved this problem. http://www.jdxyw.com/?p=590


If you are using .net 3.5 you could use some LINQ to filter out the empty ones:

var ds = from SPListItem item in GetListItemsCode()
         where item.Title != string.Empty
         select item;
0

精彩评论

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