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

Moving rows

Thread ID:





8963 Dec 1,2003 08:17 AM UTC Dec 1,2003 08:57 AM UTC WinForms 1
Tags: GridControl
Asked On December 1, 2003 08:17 AM UTC

Hello, I''m using a GridControl class in my application and I want to be able to move a range of rows around. For example, if a user deletes a row, I want to be able to move all the rows below it up one row. Each row in my grid contains a combo box, push button and/or covered cells. I''ve tried using the me.GridControl.Rows.MoveRange method to accomplish the shifting of rows, but it did not work. Are there any methods (i.e. refresh) that I need to call to see my changes after executing the MoveRange method? Does the MoveRange method work on rows that contain combo boxes, push buttons, etc? I''m using Essential Suite, Windows XP Professional, and Visual Studio Enterprise Architect 2003. Thanks, Andrew

Administrator [Syncfusion]
Replied On December 1, 2003 08:57 AM UTC

When I user clicks on a row header in a GridControl, you can delete the row using the KeyDown event.
Private Sub gridControl1_KeyDown(sender As Object, e As KeyEventArgs)
   If e.KeyCode = Keys.Delete Then
      Dim rangeList As GridRangeInfoList = gridControl1.Selections.GetSelectedRows(True, False)
      Dim range As GridRangeInfo = rangeList.ActiveRange
      If Not range.IsEmpty Then
         Me.gridControl1.Rows.RemoveRange(range.Top, range.Bottom)
         e.Handled = True
      End If
   End If
End Sub ''gridControl1_KeyDown
So, you do not really need to call Rows.MoveRange. But if you do use MoveRange from something, it should work OK for any cell type including comboboxes and push buttons provided you are not using the GridControl in a virtual manner. If you are using it in a virtual manner, you would need code in your external datasource that handles deleting or moving rows.


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

Live Chat Icon For mobile
Live Chat Icon