Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with sorting unbound DataGridView

Hi,

How do you sort an unbound Grid? I tried using the code below but received the following error:

 
Data-bound DataGridView control can only be sorted on data-bound columns.
Parameter name: dataGridViewColumn



  Me.DataGridView3.DataSource = dtsetlinkBEL.Tables(0).DefaultView.ToTable(True, New String() {"NSC"})
  Me.DataGridView3.Sort(DataGridView3.Columns.Item(0), System.ComponentModel.ListSortDirection.Ascending)

Thanks,

Victor
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland 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 Victor  Charles

ASKER

Thanks, will try it and get back to you.

V.