c# - Sorting a ListBox in WPF -
Let me start by saying that I'm completely new with WPF (this is my first project and I work in it I am doing less than a week) It is being said, please be easy on me!
I have three lists ListBox
which is bound to a LINQ query for ObservableCollection
s. In the beginning, everything is fine, all three are correctly populated. I need to drag and drop my client from one ListBox
to another. I also have this work, but when I drag the If I drop, the new one is placed below the ListBox
instead of sorting alphabetically with existing items.
How can I sort ListBox
on the runtime after code completion of the drag-and-drop operation?
Thank you!
It is not completely clear how you manage drag and drop in your code. That your listboxes are all data-bound - which means that you actually drag objects from one backing collection to another and drop it on the drop if yes, then the listbox displays only those items that are present in the archive Are there. You should either sort them or if sorting is just-visual behavior in your case (i.e. the items are actually designed from the design, are unarmed in the data model), then you should use it to wrap your collection, to sort it Set up, and tie the listbox on it.
Comments
Post a Comment