예제 #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0)
            {
                var checkCell = (DataGridViewCheckBoxCell)dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
                dataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit);
                var t = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[6].Value);

                var v = mc.GetVare(t);
                v.CurrentlyInUse = (bool)checkCell.Value;
                mc.UpdateVare(v);
                mc.UpdateMainButtons();
            }
            if (e.ColumnIndex == 3)
            {
                var t = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[6].Value);
                var v = mc.GetVare(t);
                mc.PushVareUp(v);
                InitializeList();
                mc.UpdateMainButtons();
            }
            if (e.ColumnIndex == 4)
            {
                var t = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[6].Value);
                var v = mc.GetVare(t);
                mc.PushVareDown(v);
                InitializeList();
                mc.UpdateMainButtons();
            }
            BringToFront();
        }