My problem is: when I bind datasource to DataGridView
BindingList<Contract> contracts = new BindingList<Contract>(Contract.GetAll());
dgEndingContracts.DataSource = contracts.Where(c => c.ExpirationDate <= nextMonth && c.IsArchived == false).ToList();
and set every column to SortMode = DataGridViewColumnSortMode.Automatic
when I click on dataGridView header rows doesn't sort.
But when I manually create each column, create and fill with data each row of dataGridView, and the set column sort mode to automatic, sorting works fine.
What is the difference and how can I enable sorting in first approach?
new
key word to create the columns if I am following what you are saying in your original question – MethodMan