Ejemplo n.º 1
0
        /// <summary>
        /// Return true if one or more complete rows are selected
        /// </summary>
        /// <param name="topRow"></param>
        /// <param name="bottomRow"></param>
        /// <returns></returns>

        private bool RowsSelected(
            out int topRow,
            out int bottomRow)
        {
            topRow = bottomRow = -1;

            BandedGridView bgv = RulesGrid.MainView as BandedGridView;

            GridCell[] cells = bgv.GetSelectedCells();
            if (cells.Length <= 1)
            {
                return(false);
            }

            foreach (GridCell cell in cells)
            {
                if (topRow < 0 || cell.RowHandle < topRow)
                {
                    topRow = cell.RowHandle;
                }
                if (cell.RowHandle > bottomRow)
                {
                    bottomRow = cell.RowHandle;
                }
            }

            return(true);
        }