datagridview column sort problem

N

news.microsoft.com

Hi!

I have a DatagridView lists some vehicles. Each column sort mode is set to
Automatic. However, I cannot sort any column.

Can this be related with the datasource? I have this code:

List<Vehicle> myList;

myList = new List<Vehicle>();
myList.addRange(myFunction()); //Access to a web Service
myGrdi.DataSource = myList;

Thanks in advance!

MP
 
D

Davita

Hi marco

try something like this

myGrdi.Sort(myGrdi.Columns[0], ListSortDirection.Ascending);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top