The first sort procedure below, after "InitializeComponent()", works just fine and sorts the items in my ComboBox; however, the other two identical commands which are supposed to key off the RadioButtons don't do the job. (Stepping through the program indicates
that the IF statements are visited.) Thanks in advance for any suggestions. I would really prefer to do this all in XAML, so any suggestions on that count would also be appreciated.
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); cboCust.Items.SortDescriptions.Add(new SortDescription("CompanyName", ListSortDirection.Ascending)); } private void rad_Select(object sender, RoutedEventArgs e) { RadioButton rad = sender as RadioButton; if (rad.Name.Contains("Des")) cboCust.Items.SortDescriptions.Add(new SortDescription("CompanyName", ListSortDirection.Descending)); else if (rad.Name.Contains("Asc")) cboCust.Items.SortDescriptions.Add(new SortDescription("CompanyName", ListSortDirection.Ascending)); } }