I'm making a project with C# and Visual Studio. The thing is that I'm using a GridView that I want to make sortable (in this case the Prototype Code column), I've created a button which does this:
void SortButton_Click(Object sender, EventArgs e)
{
dataGridView1.Sort(PrototypeCodeDataGridViewTextBoxColumn, System.ComponentModel.ListSortDirection.Ascending);
}
But in the moment to press the button I'm getting this:
System.InvalidOperationException: 'A DataGridView control can not be ordered if it is bound to an IBindingList that does not support the sort order.'
I've got the Prototypes.Datasource, I'm supposing that's what I have to change to make it sortable, but how? I'll appreciate your help, thank you!