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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Move the rows in the grid

Thread ID:

Created:

Updated:

Platform:

Replies:

4028 Apr 24,2003 09:40 AM UTC Apr 24,2003 03:09 PM UTC WinForms 3
loading
Tags: GridControl
Ramu
Asked On April 24, 2003 09:40 AM UTC

Hi, I'm having GDBG bounded to datasource. If the user selects one row, and click on "MoveUp" button on the form, the selected row should go one row up. I tried using CurrentCell.MoveUp(1) or (-1), but its changing the selection and not the actual row. Many thx for the help. Ram

Administrator [Syncfusion]
Replied On April 24, 2003 02:18 PM UTC

What version of the grid dll's are you using? With 1.5.2.0, I just dropped a GridDataBoundGrid on a form, hooked it to a DataTable, and the below seems to work as expected. What are you doing differently? Can you attached a sample project showingthe problem?
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        Me.gridDataBoundGrid1.CurrentCell.MoveUp(1)
    End Sub 'button1_Click


Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click
        Me.gridDataBoundGrid1.CurrentCell.MoveDown(1)
    End Sub 'button2_Click


Ramu
Replied On April 24, 2003 02:42 PM UTC

Hi Clay, Thx for u r response. Here is my sample appluication. Assume, I am having 10 rows in the grid bounded. If the user selects row number 3, and clicks moveup, the entire row contents should be moved to row 2 and the row 2 contents should be moved to row 3. same as move down. Thx in advance. Ram > What version of the grid dll's are you using? > > With 1.5.2.0, I just dropped a GridDataBoundGrid on a form, hooked it to a DataTable, and the below seems to work as expected. What are you doing differently? Can you attached a sample project showingthe problem? > >
> Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
>         Me.gridDataBoundGrid1.CurrentCell.MoveUp(1)
>     End Sub 'button1_Click
> 
> 
> Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click
>         Me.gridDataBoundGrid1.CurrentCell.MoveDown(1)
>     End Sub 'button2_Click
> 
> 

Administrator [Syncfusion]
Replied On April 24, 2003 03:09 PM UTC

The GridDataBoundGrid is just displaying the rows in the order as they are received from the datasource. There is no built-in mechanism to dynamically shuffle rows (unless you shuffle them in the datasource). If you populate a GridControl with your datatable, then you can explicitly move rows in this manner as the GridControl woul dhave its own copy of the data that it manages. One way you could try implement this functionality would be to override GridDataBoundGrid and GridModelDataBinder to get at QueryCellInfo and SaveCellInfo in the binder.

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

;