AD
Administrator
Syncfusion Team
December 7, 2004 05:05 AM
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 02:28 AM
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 06:42 PM
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 28, 2004 07:35 PM
Yes, I am doing the same thing
AD
Administrator
Syncfusion Team
December 29, 2004 02:13 AM
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