Exemple #1
0
        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();
                }
            }
        }
Exemple #2
0
 private void GV_Main_KeyDown(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();
             }
         }
     }
     if (GV_Main.IsLastRow)
     {
         if (e.KeyData == Keys.Down)
         {
             if (!IsGCCHeck)
             {
                 GV_Main.CloseEditor();
                 {
                     if (CheckRequiredField())
                     {
                         if (GV_Main.IsLastRow)
                         {
                             GV_Main.AddNewRow();
                         }
                     }
                 }
             }
             IsGCCHeck = false;
         }
     }
 }
Exemple #3
0
 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;
         }
     }
 }
Exemple #4
0
 private void GC_Main_KeyDown(object sender, KeyEventArgs e)
 {
     if (GV_Main.IsLastRow)
     {
         if (e.KeyData == Keys.Down)
         {
             GV_Main.CloseEditor();
             IsGCCHeck = true;
             {
                 if (CheckRequiredField())
                 {
                     {
                         GV_Main.AddNewRow();
                     }
                 }
             }
         }
     }
 }
Exemple #5
0
        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;
                }
            }
        }