private void GV_Main_MouseDown(object sender, MouseEventArgs e) { GridHitInfo hitInfo = GV_Main.CalcHitInfo(e.Location); if (hitInfo == null || hitInfo.Column == null) { return; } if (hitInfo.InRowCell) { if (hitInfo.Column.RealColumnEdit is RepositoryItemCheckEdit) { GV_Main.FocusedColumn = hitInfo.Column; GV_Main.FocusedRowHandle = hitInfo.RowHandle; GV_Main.ShowEditor(); CheckEdit edit = GV_Main.ActiveEditor as CheckEdit; if (edit == null) { return; } edit.Toggle(); DXMouseEventArgs.GetMouseArgs(e).Handled = true; GV_Main.CloseEditor(); } } }
private void GV_Main_MouseDown(object sender, MouseEventArgs e) { if (IsMuity) { GridHitInfo hitInfo = GV_Main.CalcHitInfo(e.Location); if (hitInfo == null || hitInfo.Column == null) { return; } if (hitInfo.InRowCell) { if (hitInfo.Column.RealColumnEdit is RepositoryItemCheckEdit) { GV_Main.FocusedColumn = hitInfo.Column; GV_Main.FocusedRowHandle = hitInfo.RowHandle; GV_Main.ShowEditor(); CheckEdit edit = GV_Main.ActiveEditor as CheckEdit; if (edit == null) { return; } edit.Toggle(); DXMouseEventArgs.GetMouseArgs(e).Handled = true; GV_Main.CloseEditor(); } } } else { if (e.Button == System.Windows.Forms.MouseButtons.Left) { GridHitInfo hi = GV_Main.CalcHitInfo(e.Location); if (hi == null || hi.Column == null) { return; } if (hi.InRowCell) { if (hi.RowHandle == mouseDownCell.RowHandle && hi.Column == mouseDownCell.Column && mouseDownTime - DateTime.Now < DoubleClickInterval) { DoRowDoubleClick(sender as GridView, e.Location); } } mouseDownCell = new GridCell(hi.RowHandle, hi.Column); mouseDownTime = DateTime.Now; } } }
private void GV_Main_InitNewRow(object sender, InitNewRowEventArgs e) { GV_Main.FocusedColumn = GV_Main.Columns["XK006"]; //定位焦点网格的位置 FocuseRow_Main = GV_Main.FocusedRowHandle; //获取新焦点行的FocuseRowHandle并初始化全局变量 GV_Main.ShowEditor(); GV_Main.SetFocusedRowCellValue("XK001", FData[0]); GV_Main.SetFocusedRowCellValue("XK002", FData[1]); GV_Main.SetFocusedRowCellValue("XK003", FData[2]); int idx = GV_Main.RowCount; GV_Main.SetFocusedRowCellValue("XK004", string.Format("{0:0000}", idx)); GV_Main.SetFocusedRowCellValue("XK005", "1"); GV_Main.SetFocusedRowCellValue("XH004", 0); IsNowAddRow = true; //GV_Main.UpdateCurrentRow(); }
private void GV_Main_MouseDown(object sender, MouseEventArgs e) { GridHitInfo hitInfo = GV_Main.CalcHitInfo(e.Location); if (hitInfo == null || hitInfo.Column == null) { return; } if (hitInfo.InRowCell) { if (hitInfo.Column.RealColumnEdit is RepositoryItemCheckEdit) { GV_Main.FocusedColumn = hitInfo.Column; GV_Main.FocusedRowHandle = hitInfo.RowHandle; GV_Main.ShowEditor(); CheckEdit edit = GV_Main.ActiveEditor as CheckEdit; if (edit == null) { return; } edit.Toggle(); DXMouseEventArgs.GetMouseArgs(e).Handled = true; GV_Main.CloseEditor(); } else if (hitInfo.Column.RealColumnEdit is RepositoryItemButtonEdit) { GC_Main.Enabled = false; GV_Main.FocusedColumn = hitInfo.Column; GV_Main.FocusedRowHandle = hitInfo.RowHandle; GV_Main.ShowEditor(); 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)); GV_Main.CloseEditor(); DXMouseEventArgs.GetMouseArgs(e).Handled = true; GC_Main.Enabled = true; } } }