How do I sort a ListBox
by two fields? (In this case the ApplicationName
and InstanceName
properties of my model class.)
相关问题
- How to toggle on Order in ReactJS
- PHP Recursively File Folder Scan Sorted by Modific
- VNC control for WPF application
- Change sort order of strings includes with a speci
- WPF Binding from System.Windows.SystemParameters.P
you can try to add both fields into the listbox items SortDescriptions collection, smth like this:
above code should sort the listbox items in the descending order by fileds ApplicatonName and InstanceName
hope this helps, regards
It depends on your data source. Here are a couple of ways....
using linq on lisbox data source
from 101 LINQ Samples:
use a CollectionView for your listbox and add a SortDescription