I bind data in my datagridview in a following way:
in my program I have a global object Obmiary, which I pass to my form.
private ClassObmiary obmiary;
private BindingSource bs;
private BindingList<ClassObmiar> bList;
public FormObmiar(ClassObmiary Obmiary)
{
InitializeComponent();
obmiary = Obmiary;
bs = new BindingSource();
bList = new BindingList<ClassObmiar>(obmiary.Obmiary);
// Fill bList with ClassObmiar
bs.DataSource = bList;
dgvObmiar.DataSource = bs;
}
The problem is when I change my global object somewhere else in the code, this dgv does not show changes. How to properly update this datagridview?
try
bs.ResetBindings(true);or
bs.ResetBindings(false);wherever you need to update the data.