/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnModify_Click(object sender, EventArgs e) { //DataGridViewColumnCollection cc = this.dgvTimeControlLine.Columns; //Console.WriteLine(cc[0].Width); //Console.WriteLine(cc[1].Width); DataGridViewRow currentRow = this.dgvTimeControlLine.CurrentRow; if (currentRow == null) { NUnit.UiKit.UserMessage.DisplayInfo(XD100Strings.FirstSelectItem); return; } if (currentRow.DataBoundItem != null) { int time = Convert.ToInt32(currentRow.Cells[0].Value); int value = Convert.ToInt32(currentRow.Cells[1].Value); frmTimeValue f = new frmTimeValue(time, value, this.GTBase2); DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { //currentRow.Cells[0].Value = f.Time; //currentRow.Cells[1].Value = f.Adjust; KeyValuePair<int, int> kv = new KeyValuePair<int, int>(f.Time, f.Adjust); int index = GetTimeIndex(f.Time); this.TimeControlLine[index] = kv; this.dgvTimeControlLine.Refresh(); this.BindZed(); } } }