This is a migrated thread and some comments may be shown as answers.

cut row from grid and insert new row on paste

0 Answers 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 25 Mar 2013, 06:41 PM
I've read over the documentation for the GridView and it covers copying to the clipboard and it sort of covers pasting  back.

My requirements are as follows:
The user can only select the entire row
The user can copy the row's contents to the clipboard
The user can cut the row's contents to the clipboard - this should cause the selected row to be deleted both in the grid and in the collection the grid is bound to.
The user can paste a new row from the clipboard.  This should cause a new row to be interested in the grid before the currently selected row (push the selected row down).

I have the copy to the clipboard working.  I'm not clear on how to catch the CTRL+X for cut, but I think the implementation should be pretty easy. 

Pasting is less clear.  Can I just replace the e.Value with a new instance of my entity w/o blowing away the object that was there?  Or do I need to do the work behind the scene -
1. create my new instance
2. find the selected instance in my collection and insert it there
3. change the selected instance to my new instance

Any suggestions or directions would be greatly appreciated.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Jake
Top achievements
Rank 1
Share this question
or