Beispiel #1
0
        void InsertItemIntoSet_Click(object sender, EventArgs e)
        {
            MyListBox member_list = this.Parent.Controls[_member_list] as MyListBox;

            if (member_list != null)
            {
                ListBox target_list = this.Parent.Controls[_target_list] as ListBox;
                if (target_list != null)
                {
                    //object selection = target_list.SelectedItem;
                    DataRow newrow = member_list.InsertSelected();
                    if (newrow != null)
                    {
                        target_list.SelectedIndex = newrow.Table.Rows.IndexOf(newrow);
                    }
                }
                else
                {
                    member_list.InsertSelected();
                }
            }
        }