Link to home
Start Free TrialLog in
Avatar of Euless_Tech
Euless_TechFlag for United States of America

asked on

Need to sort columns in DataGridView

I am using a List<> to populate a DataGridView like this:

List<object> myList = GetObjects();
DataGridView.DataSource = myList;

I would like to be able to sort the DataGridView columns without using a BindingList by clicking on the column heading. Is that possible? I've got to believe in this day and age, there are better ways to do this.

Ideas?
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Euless_Tech

ASKER

Saige,
I do not have to write anything back to the database - this datagridview is only for viewing purposes. I will give your solution a try and let you know the outcome.
Thanks Saige! Great solution