I have a XAML file with only a ListBox. I dynamically create the columns and add the rows. with this code:
ListBoxItem l1 = new ListBoxItem(); StackPanel s1 = new StackPanel(); s1.Orientation = Orientation.Horizontal; ContentPresenter ch1 = new ContentPresenter(); ch1.Content = "ICR"; s1.Children.Add(ch1); //just an example I add more than 1 column li.Content = s1; listbox.items.add(l1);
Which works fine, but now I want to create column headers and sort by column. Can I do that with a dynamically with a ListBox or am I going down the wrong path?