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 184.108.40.206, Windows XP Professional, and Visual Studio Enterprise Architect 2003.
ADAdministrator Syncfusion Team December 1, 2003 03:57 AM
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
e.Handled = True
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.