Exemplo n.º 1
0
        private void btRemoveRow_Click(object sender, System.EventArgs e)
        {
            int[] rowsIndex           = grid1.Selection.GetSelectionRegion().GetRowsIndex();
            SourceGrid.RowInfo[] rows = new SourceGrid.RowInfo[rowsIndex.Length];
            for (int i = 0; i < rows.Length; i++)
            {
                rows[i] = grid1.Rows[rowsIndex[i]];
            }

            foreach (SourceGrid.RowInfo r in rows)
            {
                grid1.Rows.Remove(r.Index);
            }

            if (grid1.RowsCount > 1)
            {
                grid1.Selection.FocusRow(1);
            }
        }
Exemplo n.º 2
0
		private void btRemoveRow_Click(object sender, System.EventArgs e)
		{
			int[] rowsIndex = grid1.Selection.GetSelectionRegion().GetRowsIndex();
			SourceGrid.RowInfo[] rows = new SourceGrid.RowInfo[rowsIndex.Length];
			for (int i = 0; i < rows.Length; i++)
				rows[i] = grid1.Rows[rowsIndex[i]];

			foreach (SourceGrid.RowInfo r in rows)
				grid1.Rows.Remove(r.Index);

			if (grid1.RowsCount > 1)
				grid1.Selection.FocusRow(1);
		}