C# DataGridView not updated when datasource is changed

前端 未结 4 669
星月不相逢
星月不相逢 2020-12-31 04:12

I have a list of object

List results;

so i added the list to the datagridview

dataGridView.DataSource =         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 05:02

    You need to implement the INotifyPropertyChanged interface on the object that is storing the data. Each property needs to raise that event during the set call of a property if the value changed. Then the grid will automatically get the update.

提交回复
热议问题