Drag & Drop DataGridRows
Here is the sample code for drag & drop of the DataGridRows I did couple of months back updated to work in beta 2
We dont get mouse events so we have to use another canvas or something which will sit on top of the datagrid at the same location as the datagird, we set the zIndex to a higher number
<Canvas Width=”300″ x:Name=”datagrid1Canvas”
Canvas.ZIndex=”2″
Margin=”80,85,0,10″
Height=”250″
Background=”Transparent”/>
you can download the source here
[...] me that he has his Twemes client upgraded to Beta 2, and details some issues he had along the way. Drag & Drop DataGridRows Lee posts about drag and drop with DataGridRows in B2 and talks about mouse issues… but I think [...]
Silverlight Cream for June 13, 2008 -- #299
June 17, 2008
Fantastic post, this is amazing…
KrishRAJ
October 29, 2008
Thanks
lee
October 29, 2008
Does this work on SL2? I am not able to open the project file.
Please help me.
Thanks
chinkul
November 7, 2008
I want to be able to move the rows around the same grid. Is it possible to do? If so can you please post the code in SL2.
Thanks
chinkul
November 7, 2008
I will update and post
lee
November 8, 2008
chinkul,
Here is the code that works in RTM
http://cid-71b364b59919d1e8.skydrive.live.com/self.aspx/Public/blog%20files/DragDropRowsRTM.zip
lee
November 8, 2008
Thanks Lee, It works beautifully.
I have 2 questions:
1. Why is the drag and drop working from top to bottom only. Why is it not working when i try to move the bottom row to top? Can we make that working?
2. Is there a possiblity to select more than one row and move all the selected rows, instead of moving each row at a time..?
Thanks Lee, you are doing great job.
Chinkul
November 8, 2008
1. In the Page_MouseLeftButtonUp handler we have a check
if (horizDrag > minimumHorizontalDragDistance || vertDrag > minimumVerticalDragDistance)
it is because of this, drag& drop wont occur for small distances
2. it should be possible, but did not try
lee
November 8, 2008