Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
How to move complete row up or down in datagrid or any grid is fine.

 

You need to manipulate the DataSource which your DataGrid is bound to.....if it is a DataTable, simply reposition the associated DataRow and it will be reflected in your DataGrid.

  • 3 weeks later...
Posted
How do you physically want to do this' date=' with drag drop or what have you in mind.[/quote']

 

1. The user selects one row

2. there will be up arrow and down arrow.

3. If the user wants to move up, the user clicks up arrow button

4. If the user wants to move down, then the user clicks down arrow button

5. if the row is at the top then up arrow button becomes disabled

6. if the row is at the bottom then down arrow button becomes disabled

Note: I think as a programmer not as a human, so use my answer at your will
Posted

kaisersoze:

I do the exact same thing you are describing in an application I developed through manipulation of the bound DataSource as I desribed above.

I take the index of the selected row in the grid and retrieve the corresponding DataRow in the DataTable and then move the DataRow up or down one position. If the user hits index 0 or Rows.Count - 1, I disable the corresponding button.

If the user selects row index 0 or Rows.Count - 1, I disable the corresponding button.

 

Piece of cake.

 

 

1. The user selects one row

2. there will be up arrow and down arrow.

3. If the user wants to move up, the user clicks up arrow button

4. If the user wants to move down, then the user clicks down arrow button

5. if the row is at the top then up arrow button becomes disabled

6. if the row is at the bottom then down arrow button becomes disabled

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...