Link to home
Start Free TrialLog in
Avatar of LenTompkins
LenTompkinsFlag for United States of America

asked on

stop datagridview from sorting columns

I have a datagridview and I set each column to be notSortable but when I run the appllication, you can sort the columns.  Then I read  where sorting has to be set in code when the data binding  is in code, but I don't know how to do this.  Can someone give me an example?  
Thanks
Avatar of LenTompkins
LenTompkins
Flag of United States of America image

ASKER

I added this in my code after the data binding and it did not not work.

dgvCallingTime.Columns["DayofWeek"].SortMode = DataGridViewColumnSortMode.NotSortable;
ASKER CERTIFIED SOLUTION
Avatar of sgvill
sgvill

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
Great it finally worked.