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

Is it possible to drag rows in a GridDataBoundGrid

I need to be able to move rows within a GDBG. Using the default settings, I can get the drag pointer to show and move the row outline. But upon release, nothing happens. Column dragging works fine. What am I missing? Doug

3 Replies

AD Administrator Syncfusion Team August 10, 2004 03:40 PM

Moving rows is not supported directly in a GridDataBoundGrid as the grid just displays the rows as they appear in the DataSource. So, depending on what your DataSource is, this may or may not be easy to do. For example, an ArrayList is easy to move rows, but in a DataTable it is not. If you want to support moving rows, you can set this property, this.gridDataBoundGrid1.Model.Options.AllowDragSelectedRows = true; , and then handle grid.Model.RowMoving and explicitly move the rows in your datasource as indicated by the event args. The grid will not try to move teh rows, it will just let you know what rows you need to move in your datasource.


FJ FJ August 12, 2004 11:55 AM

How did you have Column Dragging working fine? (a sample won''t hurt ;-)) Thank you >I need to be able to move rows within a GDBG. Using the default settings, I can get the drag pointer to show and move the row outline. But upon release, nothing happens. Column dragging works fine. > >What am I missing? > >Doug


AD Administrator Syncfusion Team August 12, 2004 12:30 PM

Column dragging works because there is a grid.GridBoundColumns property (or grid.Binder.InternalColumns property if you don''t explicitly add gridboundcolumns) that determines the order of the columns. In a GridDataBoundgrid, the normal usage is a few columns and many, many rows. So, it seems OK to expect to rearrange one of a few columns but it does not seem neccesary to reaarange one of 100000 rows. (At least that is the thinking behind supporting moving columns but not rows.) Just trying to move rows in a DataTable is problematic. Here is a forum thread that shows one way you can move rows in a DataTable (using heroic efforts). http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16227

Loader.
Live Chat Icon For mobile
Up arrow icon