private void dgvPostRoute_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView)sender).CurrentCell; int rowIndex = e.RowIndex; if ((e.RowIndex >= 0) && ((currentCell.ColumnIndex == this.dgvPostRoute.Columns["StartTime"].Index) || (currentCell.ColumnIndex == this.dgvPostRoute.Columns["EndTime"].Index))) { if ((this.dgvPostRoute.CurrentRow.Cells["PointName"].Value == null) || (this.dgvPostRoute.CurrentRow.Cells["PointName"].Value.ToString() == "")) { MessageBox.Show("请先选择站点,再添加时间。"); } else { SetDateTime time = new SetDateTime(string.IsNullOrEmpty(currentCell.Value.ToString()) ? "" : ("0000-00-00 " + currentCell.Value), true) { StartPosition = FormStartPosition.Manual, Location = Cursor.Position }; if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time.Replace("0000-00-00 ", ""); this.dgvPostRoute.EndEdit(); } } } }
private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; if (((currentCell.ColumnIndex == this.dgvArea.Columns["beginTime"].Index) || (currentCell.ColumnIndex == this.dgvArea.Columns["endTime"].Index)) && Convert.ToBoolean(this.dgvArea.Rows[currentCell.RowIndex].Cells["Choose"].Value)) { SetDateTime time = new SetDateTime((currentCell.Value.ToString().Length > 0) ? ("0000-00-00 " + currentCell.Value) : "", true); if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time.Replace("0000-00-00 ", ""); } } }
private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView)sender).CurrentCell; if (((currentCell.ColumnIndex == this.dgvArea.Columns["beginTime"].Index) || (currentCell.ColumnIndex == this.dgvArea.Columns["endTime"].Index)) && Convert.ToBoolean(this.dgvArea.Rows[currentCell.RowIndex].Cells["Choose"].Value)) { SetDateTime time = new SetDateTime((currentCell.Value.ToString().Length > 0) ? ("0000-00-00 " + currentCell.Value) : "", true); if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time.Replace("0000-00-00 ", ""); } } }
private void clbSelectRoute_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; int rowIndex = e.RowIndex; if (((e.RowIndex >= 0) && (currentCell.OwningColumn.Name.Equals("开始时间") || currentCell.OwningColumn.Name.Equals("结束时间"))) && this.clbSelectRoute.Rows[e.RowIndex].Cells["选择"].Value.ToString().Equals("1")) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; this.clbSelectRoute.EndEdit(); } } }
private void clbSelectRoute_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView)sender).CurrentCell; int rowIndex = e.RowIndex; if (((e.RowIndex >= 0) && (currentCell.OwningColumn.Name.Equals("开始时间") || currentCell.OwningColumn.Name.Equals("结束时间"))) && this.clbSelectRoute.Rows[e.RowIndex].Cells["选择"].Value.ToString().Equals("1")) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; this.clbSelectRoute.EndEdit(); } } }
private void dgvDataList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if ((e.ColumnIndex >= 0) && (e.RowIndex >= 0)) { DataGridViewCell currentCell = ((DataGridView)sender).CurrentCell; string name = this.dgvDataList[e.ColumnIndex, e.RowIndex].OwningColumn.Name; if (this.isCellSelected(currentCell.RowIndex) && (name.Equals("开始时间") || name.Equals("结束时间"))) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; } } } }
private void dgvSubSpeedParam_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView)sender).CurrentCell; if ((currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["BeginTime"].Index) || (currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["EndTime"].Index)) { DataGridViewCell cell2 = this.dgvSubSpeedParam.Rows[e.RowIndex].Cells["Choose"]; if (!string.IsNullOrEmpty(cell2.Value.ToString()) && (cell2.Value.ToString() == "1")) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; this.dgvSubSpeedParam.EndEdit(); } } } }
private void dgvPostRoute_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; int rowIndex = e.RowIndex; if ((e.RowIndex >= 0) && ((currentCell.ColumnIndex == this.dgvPostRoute.Columns["StartTime"].Index) || (currentCell.ColumnIndex == this.dgvPostRoute.Columns["EndTime"].Index))) { if ((this.dgvPostRoute.CurrentRow.Cells["PointName"].Value == null) || (this.dgvPostRoute.CurrentRow.Cells["PointName"].Value.ToString() == "")) { MessageBox.Show("请先选择站点,再添加时间。"); } else { SetDateTime time = new SetDateTime(string.IsNullOrEmpty(currentCell.Value.ToString()) ? "" : ("0000-00-00 " + currentCell.Value), true) { StartPosition = FormStartPosition.Manual, Location = Cursor.Position }; if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time.Replace("0000-00-00 ", ""); this.dgvPostRoute.EndEdit(); } } } }
private void dgvSubSpeedParam_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; int rowIndex = e.RowIndex; if ((e.RowIndex >= 0) && ((currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["BeginTime"].Index) || (currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["EndTime"].Index))) { DataGridViewCell cell2 = this.dgvSubSpeedParam.Rows[e.RowIndex].Cells["Choose"]; if ((!string.IsNullOrEmpty(cell2.Value.ToString()) && (cell2.Value.ToString() == "1")) && this.isSetTime(rowIndex)) { SetDateTime time = new SetDateTime(currentCell.Value.ToString(), false); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; this.dgvSubSpeedParam.EndEdit(); } } } else if (currentCell.OwningColumn.Name.Equals("路线属性")) { DataGridViewCell cell3 = this.dgvSubSpeedParam.Rows[e.RowIndex].Cells["Choose"]; if (!string.IsNullOrEmpty(cell3.Value.ToString()) && (cell3.Value.ToString() == "1")) { System.Drawing.Point location = this.dgvSubSpeedParam.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Location; this._路线属性.ShowDropDown(new System.Drawing.Point(location.X + 3, (location.Y + this._路线属性.Height) + 150)); } } }
private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (base.OrderCode == CmdParam.OrderCode.设置多功能区域报警) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; if ((currentCell.ColumnIndex == this.dgvArea.Columns["BeginTime"].Index) || ((currentCell.ColumnIndex == this.dgvArea.Columns["EndTime"].Index) && this.isSetTime(currentCell.RowIndex))) { SetDateTime time = new SetDateTime(currentCell.Value.ToString(), false); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; } } if (currentCell.ColumnIndex == this.dgvArea.Columns["AlarmCondition"].Index) { SetAlarmCondition condition = new SetAlarmCondition(this.m_sCustName) { AlarmCondition = currentCell.Value.ToString() }; if (condition.ShowDialog() == DialogResult.OK) { currentCell.Value = condition.AlarmCondition; } } if (currentCell.ColumnIndex == this.dgvArea.Columns["区域属性"].Index) { System.Drawing.Point location = this.dgvArea.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Location; this._区域属性.ShowDropDown(new System.Drawing.Point(location.X + 3, (location.Y + this._区域属性.Height) + 150)); } } }
private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (base.OrderCode == CmdParam.OrderCode.设置多功能区域报警) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; if ((currentCell.ColumnIndex == this.dgvArea.Columns["BeginTime"].Index) || (currentCell.ColumnIndex == this.dgvArea.Columns["EndTime"].Index)) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; } } if (currentCell.ColumnIndex == this.dgvArea.Columns["AlarmCondition"].Index) { SetAlarmCondition condition = new SetAlarmCondition(this.m_sCustName) { AlarmCondition = currentCell.Value.ToString() }; if (condition.ShowDialog() == DialogResult.OK) { currentCell.Value = condition.AlarmCondition; } } } }
private void dgvSubSpeedParam_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } DataGridViewCell currentCell = ((DataGridView)sender).CurrentCell; int rowIndex = e.RowIndex; if (e.RowIndex >= 0 && (currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["BeginTime"].Index || currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["EndTime"].Index)) { DataGridViewCell item = this.dgvSubSpeedParam.Rows[e.RowIndex].Cells["Choose"]; if (!string.IsNullOrEmpty(item.Value.ToString()) && item.Value.ToString() == "1" && this.isSetTime(rowIndex)) { SetDateTime setDateTime = new SetDateTime(string.Concat(currentCell.Value), false); if (setDateTime.ShowDialog() == DialogResult.OK) { currentCell.Value = setDateTime.Time; this.dgvSubSpeedParam.EndEdit(); return; } } } else if (currentCell.OwningColumn.Name.Equals("路线属性")) { DataGridViewCell dataGridViewCell = this.dgvSubSpeedParam.Rows[e.RowIndex].Cells["Choose"]; if (!string.IsNullOrEmpty(dataGridViewCell.Value.ToString()) && dataGridViewCell.Value.ToString() == "1") { Rectangle cellDisplayRectangle = this.dgvSubSpeedParam.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false); System.Drawing.Point location = cellDisplayRectangle.Location; this._路线属性.ShowDropDown(new System.Drawing.Point(location.X + 3, location.Y + this._路线属性.Height + 150)); } } }
private void dgvDataList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if ((e.ColumnIndex >= 0) && (e.RowIndex >= 0)) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; string name = this.dgvDataList[e.ColumnIndex, e.RowIndex].OwningColumn.Name; if (this.isCellSelected(currentCell.RowIndex) && (name.Equals("开始时间") || name.Equals("结束时间"))) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; } } } }
private void dgvPath_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridViewCell currentCell = this.dgvPath.CurrentCell; if ((e.RowIndex >= 0) && (currentCell.OwningColumn.Name.ToLower().Equals("begintm") || currentCell.OwningColumn.Name.ToLower().Equals("endtm"))) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; this.dgvPath.EndEdit(); } } else if (this.dgvPath.CurrentCell.OwningColumn.Name.ToLower().Equals("pathattr")) { System.Drawing.Point location = this.dgvPath.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Location; this._路线属性.ShowDropDown(new System.Drawing.Point(location.X + 3, (location.Y + this._路线属性.Height) + 150)); } }
private void dgvSubSpeedParam_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell; if ((currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["BeginTime"].Index) || (currentCell.ColumnIndex == this.dgvSubSpeedParam.Columns["EndTime"].Index)) { DataGridViewCell cell2 = this.dgvSubSpeedParam.Rows[e.RowIndex].Cells["Choose"]; if (!string.IsNullOrEmpty(cell2.Value.ToString()) && (cell2.Value.ToString() == "1")) { SetDateTime time = new SetDateTime(currentCell.Value.ToString()); ///ToString if (time.ShowDialog() == DialogResult.OK) { currentCell.Value = time.Time; this.dgvSubSpeedParam.EndEdit(); } } } }