no it works On Wed, Oct 22, 2008 at 10:15 AM, ross jempson <[EMAIL PROTECTED]>wrote:
> Wouldn't this option you presented create a runtime cast error anyway? > > List<UIElement> elements = > > (List<UIElement>)VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null),this); > > Hence .ToList() is better I would suggest. > > Another thing to consider is whether you actually need a List<> which > forces the list to be fully populated. Leaving it as an IEnumerable<> > will be more effecient in some scenarios, as the datasource may be > lazy loading. > > > On Wed, Oct 22, 2008 at 2:26 AM, .net noobie <[EMAIL PROTECTED]> > wrote: > > Thanks, I found this link for a ListBox version > > needed to update the .HitTest to SL2 and it works fine > > I only wanted a single column, I used a DataGrid because I was being lazy > > and wanted to use the DataGrid Header, but I will just make that for a > > ListBox :) > > changed this line for SL2 > > List<UIElement> elements = > > (List<UIElement>)this.HitTest(e.GetPosition(null)); > > to > > List<UIElement> elements = > > > (List<UIElement>)VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null), > > this); > > > > > http://cid-71b364b59919d1e8.skydrive.live.com/self.aspx/Public/blog%20files/dragdrop|_updated.zip > > which is the better way to do this line? > > List<UIElement> elements = > > > (List<UIElement>)VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null), > > this); > > or > > List<UIElement> elements = > > VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null), > > this).ToList(); > > which one takes more work under the covers to make the conversion to a > list? > > > > On Tue, Oct 21, 2008 at 8:57 PM, Valentin Stoychev > > <[EMAIL PROTECTED]> wrote: > >> > >> I hope you will not treat this as an advertisement. > >> > >> Take a look at this example from the Telerik QuickStart Application. > >> http://demos.telerik.com/silverlight/#Examples/DragAndDrop/FirstLook > >> > >> It is using the Telerik Drag/Drop framework that do exactly what you > need, > >> but with listboxes. Modifying the sample a little bit will do the job > for a > >> DataGrid. > >> > >> Regards, > >> Valentin Stoychev > >> Telerik > >> > >> On Tue, Oct 21, 2008 at 1:05 PM, Stephen Price < > [EMAIL PROTECTED]> > >> wrote: > >>> > >>> I got drag and drop between listboxes working in a prototype I was > >>> working on few months ago. > >>> I used canvas's and a method that checked for a collision/overlap > between > >>> the two elements when you did the drop. > >>> Used the standard mouse approach of move events while button down to > >>> animate the dragging around part. Had to clone the image element myself > as > >>> no clone in Silverlight. I've since had an idea of another way to copy > the > >>> image but haven't been back to test out my idea. (maybe using brush > source - > >>> you know how you can have video brushes all pointing at same source? > >>> wondering if that would work with an image brush). > >>> hope that makes sense... > >>> cheers, > >>> Stephen > >>> > >>> On Tue, Oct 21, 2008 at 4:00 PM, .net noobie <[EMAIL PROTECTED]> > >>> wrote: > >>>> > >>>> I would like to be able to Drop & Drag a DataGridRow from one DataGrid > >>>> to another...? > >>>> does anyone have any tips or links on how I would do this please? > >>>> > >>>> -- > >>>> .net noobie™ > >>>> > >>>> ------------------------------------------------------------------- > >>>> OzSilverlight.com - to unsubscribe from this list, send a message back > to > >>>> the list with 'unsubscribe' as the subject. > >>>> Powered by mailenable.com - List managed by www.readify.net > >>> > >>> ------------------------------------------------------------------- > >>> OzSilverlight.com - to unsubscribe from this list, send a message back > to > >>> the list with 'unsubscribe' as the subject. > >>> Powered by mailenable.com - List managed by www.readify.net > >> > >> ------------------------------------------------------------------- > >> OzSilverlight.com - to unsubscribe from this list, send a message back > to > >> the list with 'unsubscribe' as the subject. > >> Powered by mailenable.com - List managed by www.readify.net > > > > > > -- > > .net noobie™ > > > > ------------------------------------------------------------------- > > OzSilverlight.com - to unsubscribe from this list, send a message back to > > the list with 'unsubscribe' as the subject. > > Powered by mailenable.com - List managed by www.readify.net > > > ------------------------------------------------------------------- > OzSilverlight.com - to unsubscribe from this list, send a message back to > the list with 'unsubscribe' as the subject. > Powered by mailenable.com - List managed by www.readify.net > > > -- .net noobie™ ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net