开发者

C# sort Listbox, add to a sorted list

I want to sort the elements in C# listbox by some field in the object element.

Is there a method in C# that perform t开发者_如何学Gohis task? Maybe a function that receives a comparison function as a parameter or something like that?

another thing, when the listbox is sorted I want to add an element to a sorted list. is there such a method?

thanks


I would suggest using classical winforms binding to a System.Collections.SortedList.List<TKey,TValue> . All of the sorting will be done for you by the list, and most of the data transactions to and from the ListBox control will be done for you by the binding framework.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜