Current filter:
                                You should refresh the page.
                                  • Hello,

                                    I have a PivotGridControl called grdBooking and it has a GrdBooking_CustomDrawCell(object sender, PivotCustomDrawCellEventArgs e) action. This action triggers for each cell of grdBooking's visible part. When I scroll over grid, visible part changes and GrdBooking_CustomDrawCell action triggers again for the rest of the grid.

                                    Now, I want to catch the last visible cell, which GrdBooking_CustomDrawCell action triggers for. Then I will close my loading spinner (SplashScreenManager).

                                    I realized that grdBooking.Cells.ColumnCount and grdBooking.Cells.RowCount gives me the total cells count. But I need the cell count of visible part to catch if it is the last triggered action. My action looks like this:

                                    [C#]
                                    private void GrdBooking_CustomDrawCell(object sender, PivotCustomDrawCellEventArgs e) { // My other code logic here... if (e.RowIndex == 17 && e.ColumnIndex == 17 && splashScreenIsActive) { SplashScreenManager.CloseDefaultWaitForm(); splashScreenIsActive = false; } }

                                    In "if" statement, 17 is hardcoded. Instead, I need to put the last visible cell's RowIndex and ColumnIndex to compare with current cell indexes.

                                    In debug mode, I saw the incoming parameter e contains e.ViewInfo.ScrollBarSize.Width and Height which is exactly matches my last visible cell indexes (17). But since e.ViewInfo is a protected property, I cannot call that property to get the value.

                                    I need an urgent help to get that ScrollBarSize values, since this problem takes my days. Attached images of grdBooking and ScrollBarSize property in Locals window of Visual Studio.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,

                                The e.ViewInfo.ScrollBarSize.Width and Height properties determine the width and height of the vertical and horizontal scrollbars in pixels. These properties are not related to visible cells. At present, PivotGridControl does not store information about the number of visible rows and cells.

                                As a possible solution, you can determine the last visible cell by comparing its right-bottom coordinate with the control's bounds:

                                [C#]
                                private void pivotGridControl1_CustomDrawCell(object sender, PivotCustomDrawCellEventArgs e) { bool IsLastVisibleColumn = e.Bounds.Right >= pivotGridControl1.Bounds.Right || e.ColumnIndex == pivotGridControl1.Cells.ColumnCount -1; bool IsLastVisibleRow = e.Bounds.Bottom >= pivotGridControl1.Bounds.Bottom || e.RowIndex == pivotGridControl1.Cells.RowCount - 1; if (IsLastVisibleColumn && IsLastVisibleRow) { // It is the last visible cell } }

                                Try this approach in your application and let me know whether it meets your requirements.