I have a datagridview in my form and I populate it with this:
dataGridView1.DataSource = students.Select(s => new { ID = s.StudentId, RUDE = s.RUDE, Nombre = s.Name, Apellidos = s.LastNameFather + " " + s.LastNameMother, Nacido = s.DateOfBirth }) .OrderBy(s => s.Apellidos) .ToList();
Now I use s.Apellidos as the default sort, but I would also like to allow users to sort by clicking on the column heading.
This type will not modify the data in any way, it is just a bonus on the client side to facilitate the search for information when scanning the screen with your eyes.
Thanks for the suggestions.
sorting c # winforms datagridview
delete Apr 05 2018-11-11T00: 00Z
source share