public void Add(ListItemUserControl control) { if (IsDisposed) { return; } if (InvokeRequired) { Invoke(new AddControlDelegate(Add), control); } else { Controls.Add(control); // registers list item's children's click event handlers // so that they will all call the same callback method control.ItemClick += Control_ItemClick; OnDataSetChanged(); } }
public void Remove(ListItemUserControl control) { Controls.Remove(control); OnDataSetChanged(); }