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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ctrl-end and hidden rows...

Thread ID:





67977 Sep 5,2007 06:12 PM UTC Sep 6,2007 09:43 PM UTC WinForms 1
Tags: GridControl
Philip Bishop
Asked On September 5, 2007 06:12 PM UTC

We are working on an app now that has hidden rows for various reasons. Normally when you hit ctrl-end, it will take you to the last row/col in the grid. So if your have 99 rows and 128 cols then the ctrl-end would put you in 99,128. If I only show 32 rows and hide the rest then when I hit ctrl-end it takes me below row 32 and highlights just what appears to be the border bottom of row 32. What I think it is doing is really going to row 99, but since it is hidden it is confused on what to do. Is this how it is suppose to work? I have a sample if needed.

Rajagopal [Syncfusion]
Replied On September 6, 2007 09:43 PM UTC

Hi Philip,

This behavior can be avoided by handling the MoveCurrentCellDirection event of the GridControl. In the event handler, check the Direction when the ctr+end is pressed and accordingly move the currentcell to the lastvisiblerow row. Please try the below code.

Private Function GetLastVisibleRow(ByVal grid As GridControl) As Integer
Dim lastRow As Integer = -1
For row As Integer = grid.RowCount To 1 Step -1
If (Not grid.Rows.Hidden(row)) Then
lastRow = row
Exit For
End If
Next row
Return lastRow
End Function

Private Sub gridControl1_MoveCurrentCellDirection(ByVal sender As Object, ByVal e As GridMoveCurrentCellDirectionEventArgs)
If e.Direction = GridDirectionType.BottomRight Then ' ctrl + End
e.Result = False
e.Handled = True
Dim lastVisibleRow As Integer = GetLastVisibleRow(gridControl1)
Me.gridControl1.CurrentCell.MoveTo(lastVisibleRow, gridControl1.ColCount, GridSetCurrentCellOptions.ScrollInView)
End If
End Sub

Let me know if this helps.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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