We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Bottom most row of the gridcontrol should not be selected

Hi, I want that bottommost row the gridcontrol should not be selected. Each time I add a new row at the top then also the same thing should apply to the bottommost row only. Can you help?

5 Replies

AD Administrator Syncfusion Team December 7, 2004 10:05 AM UTC

What do you mean by selected? Do you mean it cannot contain the CurrentCell? Or, do you mean it cannot belong to the grid.Selections collection? Or, something else? If you do not want the last row to ever contain the CurrentCell, then try handling the grid.CurrentCellMoving event. If grid.CurrentCell.MoveToRowIndex equals grid.RowCount, then set e.Cancel = true. If you do not want the last row to ever be in the grid.Selections collection, then try handling the grid.SelectionsChanging event. If e.Range intersects GridRangeInfo.Row(grid.RowCount), then set e.Cancel = true.


AD Administrator Syncfusion Team December 28, 2004 07:28 AM UTC

Using this code i am able to make sure that row zero is not selected. But there is one problem with this. Suppose i have pressed Shift key and then i select any row and the bottom most row, the bottom most row in not available in grid.Selections, but the bottommost row is still seen as highlighted which gives the impression that it is selected. How do i overcome this problem


AD Administrator Syncfusion Team December 28, 2004 11:42 PM UTC

Are you handling the SelectionsChanging event and setting e.Cancel = true if e.Range.IntersectsWith(GridRangeInfo.Row(grid.Model.RowCount) is true?


AD Administrator Syncfusion Team December 29, 2004 12:35 AM UTC

Yes, I am doing the same thing


AD Administrator Syncfusion Team December 29, 2004 07:13 AM UTC

In this sample, handling the SelectionsChanging event seems to prevent the last row from being selected even using the shift key. How do I see the problem in this sample? http://64.78.18.34/Forums/Uploads/GC_FormulaForum.zip

Loader.
Live Chat Icon For mobile
Up arrow icon