private void add_Click(object sender, System.EventArgs e) { ICollectionEditType gv = _varients.AddNew(); varlist.Items.Add(gv.Name); _vhash.Add(gv.Name, gv); varlist.SelectedItem = gv.Name; // prop.SelectedObject=gv; }
private void delete_Click(object sender, System.EventArgs e) { int index = varlist.SelectedIndex; if (index > -1) { ICollectionEditType gv = _vhash[varlist.SelectedItem] as ICollectionEditType; _varients.Remove(gv); varlist.Items.Remove(gv.Name); _vhash.Remove(gv.Name); if (varlist.Items.Count > index) { prop.SelectedObject = _vhash[varlist.SelectedItem]; } else { varlist.SelectedIndex = varlist.Items.Count - 1; } } if (varlist.Items.Count == 0) { prop.SelectedObject = null; } }
public void Remove(ICollectionEditType ice) { this.InnerList.Remove(ice); }