Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
                    }
                }
            }
        }
Exemplo n.º 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;
                    }
                }
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
            }
        }