コード例 #1
0
        void cell_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                tsmSetRowsInColumn.Visible = true;

                m_contextCell = sender as Xceed.Grid.DataCell;
                contextMenuStrip1.Show(m_contextCell.PointToScreen(new System.Drawing.Point(e.X, e.Y)));

                m_contextSelector = null;
            }
        }
コード例 #2
0
        void RowSelector_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                tsmSetRowsInColumn.Visible = false;

                m_contextSelector = sender as Xceed.Grid.RowSelector;
                contextMenuStrip1.Show(m_contextSelector.PointToScreen(new System.Drawing.Point(e.X, e.Y)));

                m_contextCell = null;
            }
        }
コード例 #3
0
 void tsmCopy_Click(object sender, EventArgs e)
 {
     if (m_contextCell != null)
     {
         CopySelectedCellsToClipboard(m_contextCell);
         m_contextCell = null;
     }
     else if (m_contextSelector != null)
     {
         CopySelectedRowsToClipboard(m_contextSelector.Row);
         m_contextSelector = null;
     }
 }
コード例 #4
0
 void tsmAddNew_Click(object sender, System.EventArgs e)
 {
     if (m_contextCell != null)
     {
         this.DataRows.AddNew().EndEdit();
         m_contextCell = null;
     }
     else if (m_contextSelector != null)
     {
         this.DataRows.AddNew().EndEdit();
         m_contextSelector = null;
     }
 }
コード例 #5
0
 void tsmCut_Click(object sender, EventArgs e)
 {
     if (m_contextCell != null)
     {
         CopySelectedCellsToClipboard(m_contextCell);
         ClearSelectedCells(m_contextCell);
         m_contextCell = null;
     }
     else if (m_contextSelector != null)
     {
         IList <Xceed.Grid.Row> rowList = CopySelectedRowsToClipboard(m_contextSelector.Row);
         DeleteRows(rowList);
         m_contextSelector = null;
     }
 }
コード例 #6
0
        void tsmDelete_Click(object sender, EventArgs e)
        {
            if (m_contextCell != null)
            {
                m_contextCell.Value = null;
                m_contextCell       = null;
            }
            else if (m_contextSelector != null)
            {
                IList <Xceed.Grid.Row> rowList = GetSelectedRowsToOperation(m_contextSelector.Row);
                DeleteRows(rowList);

                m_contextSelector = null;
            }
        }
コード例 #7
0
        void tsmInsert_Click(object sender, EventArgs e)
        {
            int currentRowIdx = -1;

            if (m_contextCell != null)
            {
                currentRowIdx = (m_contextCell.ParentRow as Xceed.Grid.DataRow).Index;
                m_contextCell = null;
            }
            else if (m_contextSelector != null)
            {
                currentRowIdx     = (m_contextSelector.Row as Xceed.Grid.DataRow).Index;
                m_contextSelector = null;
            }
            if (currentRowIdx != -1)
            {
                int lastRow = this.FindLastEditRow();

                if (lastRow >= currentRowIdx)
                {
                    if (lastRow == this.DataRows.Count - 1)
                    {
                        this.DataRows.AddNew().EndEdit();
                    }

                    for (int i = lastRow; i >= currentRowIdx; --i)
                    {
                        for (int j = 0; j < this.Columns.Count; ++j)
                        {
                            this.DataRows[i + 1].Cells[j].Value = this.DataRows[i].Cells[j].Value;
                        }
                    }
                    for (int j = 0; j < this.Columns.Count; ++j)
                    {
                        this.DataRows[currentRowIdx].Cells[j].Value = null;
                    }
                }
            }
        }
コード例 #8
0
        void tsmInsert_Click(object sender, EventArgs e)
        {
            int currentRowIdx = -1;
            if (m_contextCell != null)
            {
                currentRowIdx = (m_contextCell.ParentRow as Xceed.Grid.DataRow).Index;
                m_contextCell = null;
            }
            else if (m_contextSelector != null)
            {
                currentRowIdx = (m_contextSelector.Row as Xceed.Grid.DataRow).Index;
                m_contextSelector = null;
            }
            if (currentRowIdx != -1)
            {
                int lastRow = this.FindLastEditRow();

                if (lastRow >= currentRowIdx)
                {
                    if (lastRow == this.DataRows.Count - 1)
                    {
                        this.DataRows.AddNew().EndEdit();
                    }

                    for (int i = lastRow; i >= currentRowIdx; --i)
                    {
                        for (int j = 0; j < this.Columns.Count; ++j)
                        {
                            this.DataRows[i + 1].Cells[j].Value = this.DataRows[i].Cells[j].Value;
                        }
                    }
                    for (int j = 0; j < this.Columns.Count; ++j)
                    {
                        this.DataRows[currentRowIdx].Cells[j].Value = null;
                    }
                }
            }
        }
コード例 #9
0
        void tsmDelete_Click(object sender, EventArgs e)
        {
            if (m_contextCell != null)
            {
                m_contextCell.Value = null;
                m_contextCell = null;
            }
            else if (m_contextSelector != null)
            {
                IList<Xceed.Grid.Row> rowList = GetSelectedRowsToOperation(m_contextSelector.Row);
                DeleteRows(rowList);

                m_contextSelector = null;
            }
        }
コード例 #10
0
 void tsmCut_Click(object sender, EventArgs e)
 {
     if (m_contextCell != null)
     {
         CopySelectedCellsToClipboard(m_contextCell);
         ClearSelectedCells(m_contextCell);
         m_contextCell = null;
     }
     else if (m_contextSelector != null)
     {
         IList<Xceed.Grid.Row> rowList = CopySelectedRowsToClipboard(m_contextSelector.Row);
         DeleteRows(rowList);
         m_contextSelector = null;
     }
 }
コード例 #11
0
 void tsmCopy_Click(object sender, EventArgs e)
 {
     if (m_contextCell != null)
     {
         CopySelectedCellsToClipboard(m_contextCell);
         m_contextCell = null;
     }
     else if (m_contextSelector != null)
     {
         CopySelectedRowsToClipboard(m_contextSelector.Row);
         m_contextSelector = null;
     }
 }
コード例 #12
0
 void tsmAddNew_Click(object sender, System.EventArgs e)
 {
     if (m_contextCell != null)
     {
         this.DataRows.AddNew().EndEdit();
         m_contextCell = null;
     }
     else if (m_contextSelector != null)
     {
         this.DataRows.AddNew().EndEdit();
         m_contextSelector = null;
     }
 }
コード例 #13
0
        void RowSelector_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                tsmSetRowsInColumn.Visible = false;

                m_contextSelector = sender as Xceed.Grid.RowSelector;
                contextMenuStrip1.Show(m_contextSelector.PointToScreen(new System.Drawing.Point(e.X, e.Y)));

                m_contextCell = null;
            }
        }
コード例 #14
0
        void cell_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                tsmSetRowsInColumn.Visible = true;

                m_contextCell = sender as Xceed.Grid.DataCell;
                contextMenuStrip1.Show(m_contextCell.PointToScreen(new System.Drawing.Point(e.X, e.Y)));

                m_contextSelector = null;
            }
        }