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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Bottom most row of the gridcontrol should not be selected

Thread ID:

Created:

Updated:

Platform:

Replies:

22204 Dec 7,2004 08:51 AM UTC Dec 29,2004 07:13 AM UTC Windows Forms 5
loading
Tags: GridControl
Sapna Jain
Asked On December 7, 2004 08:51 AM UTC

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?

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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?

Administrator [Syncfusion]
Replied On December 29, 2004 12:35 AM UTC

Yes, I am doing the same thing

Administrator [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;