hi i have datagridview name data1, and binding data to data1 from database, when i click the column header for sorting the data,,some error show up..the error like this "DataGridView control must be bound to an IBindingList object to be sorted".
this is sample of the code..
SomeDataContext db = new SomeDataContext();
data1.DataSource = db.data.ToList();
private void data1_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
dataGridView1.Sort(dataGridView1.Columns[e.ColumnIndex],
ListSortDirection.Ascending);
}
any solution guys??thanks in advance