السلام عليكم
لدي بيانات موجودة في DataGridView ارغب بترتيبها استخدمت الكود التالي
private void dataGridView2_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
; (dataGridView2.Sort(dataGridView2.Columns[e.ColumnIndex], ListSortDirection.Ascending
}
وعند تنفيد الكود حدث الاستثناء التالي:
DataGridView control must be bound to an IBindingList object to be sorted
ارجو المساعدة ولكم جزيل الشكر