private void GC_Main_EditorKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { if (F2FieldBody.Contains(GV_Main.FocusedColumn.FieldName)) { ButtonEdit edit = (GV_Main.ActiveEditor as ButtonEdit); EditorButton eb = ((RepositoryItemButtonEdit)GV_Main.FocusedColumn.ColumnEdit).Buttons[0]; PerformClick(GV_Main.FocusedColumn.FieldName, edit, new ButtonPressedEventArgs(eb)); } } }
public void SetButtonEditField() { for (int i = 0; i < ButtonFieldListBody.Count; i++) { if (ButtonFieldListBody[i].Field == "" || ButtonFieldListBody[i].Field == null) { continue; } GCNum mTableType = ButtonFieldListBody[i].TableType; GV_Main.Columns[ButtonFieldListBody[i].Field].ColumnEdit = ButtonFieldListBody[i]; F2FieldBody.Add(ButtonFieldListBody[i].Field); } }
private void GC_Main_EditorKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && e.Modifiers == Keys.Control) { if (GV_Main.RowCount > 0 && FocuseRow_Main <= GV_Main.RowCount) { if (MessageBox.Show("確定要刪除此筆資料?", "詢問", MessageBoxButtons.OKCancel) == DialogResult.OK) { IsNowDeleteRow = true; GV_Main.DeleteRow(FocuseRow_Main); GV_Main.RefreshData(); } } } else if (e.KeyCode == Keys.F2) { if (F2FieldBody.Contains(GV_Main.FocusedColumn.FieldName)) { ButtonEdit edit = (GV_Main.ActiveEditor as ButtonEdit); EditorButton eb = ((RepositoryItemButtonEdit)GV_Main.FocusedColumn.ColumnEdit).Buttons[0]; PerformClick(GV_Main.FocusedColumn.FieldName, edit, new ButtonPressedEventArgs(eb)); } } }