예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            cTypeOrderPole   ctop = new cTypeOrderPole();
            FormEditPoleName F    = new FormEditPoleName(ctop, "Добавить");

            if (F.ShowDialog(this) == DialogResult.OK)
            {
                DataRowView drvchild = TypeOrderPoleView.AddNew();
                ctop.ThisToRow(drvchild.Row);
                drvchild.EndEdit();

                ReNumberChild();

                listView1.VirtualListSize = TypeOrderPoleView.Count;
                listView1.Refresh();
            }
        }
예제 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedIndices.Count > 0)
            {
                int            n        = listView1.SelectedIndices[0];
                DataRowView    drvchild = TypeOrderPoleView[n];;
                cTypeOrderPole ctop     = new cTypeOrderPole(drvchild.Row);

                FormEditPoleName F = new FormEditPoleName(ctop, "Изменить");
                if (F.ShowDialog(this) == DialogResult.OK)
                {
                    drvchild.BeginEdit();
                    ctop.ThisToRow(drvchild.Row);
                    drvchild.EndEdit();

                    listView1.VirtualListSize = TypeOrderPoleView.Count;
                    listView1.Refresh();
                }
            }
        }