The statement:
bb = oSerializer.Deserialize<BindingList<BackupItem>>(tmp);
is creating a whole new object, pointing to a different memory location from where checkedListBox1.DataSource
is pointing to.
What you need to do is modify the content of the bb
variable. First clear the content then add the new items. Something like this:
private void toolStripJSONLoad_Click(object sender, EventArgs e)
{
string tmp = File.ReadAllText(@"D:\path.txt", Encoding.UTF8);
JavaScriptSerializer oSerializer = new JavaScriptSerializer();
var tmpObj = oSerializer.Deserialize<List<BackupItem>>(tmp);
bb.Clear();
tmpObj.ForEach(o => bb.Add(o));
}