コード例 #1
0
        /// <summary>
        /// Gets the index of the row positioned at the start of the previous page that is not currently in view of SfTreeGrid.
        /// </summary>
        /// <returns>
        /// The start index of previous page.
        /// </returns>
        public static int GetPreviousPageIndex(this SfTreeGrid treeGrid)
        {
            int previousPageIndex = treeGrid.TreeGridPanel.ScrollRows.GetPreviousPage(treeGrid.SelectionController.CurrentCellManager.CurrentRowColumnIndex.RowIndex);
            var firstRowIndex     = treeGrid.GetFirstDataRowIndex();

            previousPageIndex = previousPageIndex < firstRowIndex ? firstRowIndex : previousPageIndex;
            return(previousPageIndex);
        }
コード例 #2
0
        /// <summary>
        /// Gets the previous row info at the specified row index of SfTreeGrid.
        /// </summary>
        /// <param name="TreeGrid">
        /// The corresponding TreeGrid to get previous row info.
        /// </param>
        /// <param name="rowIndex">
        /// The corresponding index of row to get previous row info.
        /// </param>
        /// <returns>
        /// Returns the previous row info of specified row index.
        /// </returns>
        public static TreeGridRowInfo GetPreviousRowInfo(this SfTreeGrid TreeGrid, int rowIndex)
        {
            if (rowIndex < 0)
            {
                throw new InvalidOperationException("Negative rowIndex in GetNextRecordEntry");
            }

            if (rowIndex == TreeGrid.GetFirstDataRowIndex() &&
                rowIndex == TreeGrid.SelectionController.CurrentCellManager.CurrentRowColumnIndex.RowIndex)
            {
                rowIndex = TreeGrid.TreeGridPanel.ScrollRows.GetNextScrollLineIndex(rowIndex);
            }

            //The Below condition is Checked with while Editing the Record if it gets the View then we have to give the Selection.
            if (rowIndex > TreeGrid.GetLastDataRowIndex() || rowIndex < TreeGrid.GetFirstDataRowIndex())
            {
                return(null);
            }

            var rowInfo = (TreeGrid.SelectionController as TreeGridBaseSelectionController).GetTreeGridSelectedRow(rowIndex);

            return(rowInfo);
        }
コード例 #3
0
        /// <summary>
        /// Gets the index of the row positioned at the end of next page that is not currently in view of SfTreeGrid.
        /// </summary>
        /// <returns>
        /// Returns the end row index of next page.
        /// </returns>
        public static int GetNextPageIndex(this SfTreeGrid treeGrid)
        {
            var rowIndex = treeGrid.SelectionController.CurrentCellManager.CurrentRowColumnIndex.RowIndex;

            if (rowIndex < treeGrid.GetFirstDataRowIndex())
            {
                rowIndex = 0;
            }
            var nextPageIndex = treeGrid.TreeGridPanel.ScrollRows.GetNextPage(rowIndex);
            var lastRowIndex  = treeGrid.GetLastDataRowIndex();

            nextPageIndex = nextPageIndex <= lastRowIndex ? nextPageIndex : lastRowIndex;
            return(nextPageIndex);
        }
コード例 #4
0
        /// <summary>
        /// Gets the next row info at the specified row index in SfTreeGrid.
        /// </summary>
        /// <param name="TreeGrid">
        /// The corresponding TreeGrid to get next row info.
        /// </param>
        /// <param name="rowIndex">
        /// The corresponding index of row to get next row info
        /// </param>
        /// <returns>
        /// Returns the next row info of the specified row index.
        /// </returns>
        public static TreeGridRowInfo GetNextRowInfo(this SfTreeGrid TreeGrid, int rowIndex)
        {
            if (rowIndex < 0)
            {
                return(null);
            }

            if (rowIndex == TreeGrid.GetLastDataRowIndex() &&
                rowIndex == TreeGrid.SelectionController.CurrentCellManager.CurrentRowColumnIndex.RowIndex)
            {
                rowIndex = TreeGrid.TreeGridPanel.ScrollRows.GetPreviousScrollLineIndex(rowIndex);
            }

            if (rowIndex > TreeGrid.GetLastDataRowIndex() || rowIndex < TreeGrid.GetFirstDataRowIndex())
            {
                return(null);
            }

            var rowInfo = (TreeGrid.SelectionController as TreeGridBaseSelectionController).GetTreeGridSelectedRow(rowIndex);

            return(rowInfo);
        }