Hi,I wan to sort my added record on the top of datagridview.I had try a few way to sort it but it no function."attn_id"is a primary key in database.
using (TMPB_attn_DAL dalObj = new TMPB_attn_DAL())
{
dataGridView1.DataSource = dalObj.GetRecords().Cast<TMPB_attn>().ToList();
dataGridView1.Refresh();
dataGridView1.Sort(dataGridView1.Columns["attn_id"], ListSortDirection.Descending);
}
when i run the above code it show out error!Datagridview control must be bound to an iBindingList object to be sorted
how can i sort the record?