Telerik Forums
UI for WPF Forum
5 answers
155 views
Is there an example of manually starting a drag via StartDrag?

Here is what I am attempting to do:
Drag files (ie from Windows Explorer, Desktop, etc) to a Telerik control (in this instance a RadTreeListView).

What I already have working:
Dragging within the RadTreeListView is fully implemented

What I have tried:
Register the DragOver event on the RadTreeListView with this code:

if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
   if (!RadDragAndDropManager.IsDragging)
        {
            Collection<object> pPayload = new Collection<object>();
            if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
            {
                foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                {
                    if (File.Exists(pFilePath))
                    {
                        pPayload.Add(pFilePath);
                    }
                }
            }
            if (pPayload.Count > 0)
            {
                RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
            }
        }

The problem is it never starts the drag!  Is there something I am missing?  I would have thought this would have kick-started the Rad Drag and Drop features, but it doesn't seem to do anything.


Travis
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            
Tsvyatko
Telerik team
 answered on 11 Dec 2010
1 answer
137 views
Hi
I am using Windows XP.I want to change the blue color around my customized window used as a message box.I want that blue color to be replaced by some glassy color as it is in vista or windows 7.please help me out in changing that blue color around it  as soon as possible.
George
Telerik team
 answered on 11 Dec 2010
3 answers
87 views
In Windows7Theme this componnets alongside look bad.
http://img819.imageshack.us/img819/4333/themewin7.jpg


In other themes same screen looks good.
Dani
Telerik team
 answered on 11 Dec 2010
3 answers
546 views
Hello,

I´m translating the strings in the DatePicker to a not supported language, and I want to know what the name om the property is that sets the "Enter date" tooltip string?

Best regards,
Anna
Kaloyan
Telerik team
 answered on 11 Dec 2010
1 answer
151 views
I've included the map in one of my project. I took the example from the help documentation just to play a little bit with it before actually implemented in a production apps. The problem is that I cannot see any tiles. Everything else seem working (pan, zoom,...).

Anything that can help me? Maybe is because it have issue connecting to the web?
Gabriel Mongeon
Top achievements
Rank 1
 answered on 11 Dec 2010
1 answer
162 views
Is it possible to access the dbf file during the binding (see below):

this

 

 

.StateLayer.Reader.DataSource = new Uri(string.Format(ShapeRelativeUriFormat, "usa_states.dbf"), UriKind.Relative);

I would like to append some text to each of the state names, if I could do some sort of loop / foreach that would be great. Can you provide sample code?

Regards
Thomas

 

 

 

Andrey
Telerik team
 answered on 10 Dec 2010
3 answers
272 views

I need to apply a data template to a grid view cell using a cell template selector similar to the approach provided in one of the grid view demo's. My template looks like this:

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock Text="{Binding Converter={StaticResource dataRowConverter}}" Foreground="Gray" />

 

 

 

 

</DataTemplate>

The data grid is bound to a data table, so I use the dataRowConverter to try to get the right column value out of the data row that is passed to it by this template. My problem is that in the converter, I do not have the index to the data row to get the corresponding value for the grid view cell being processed. How am I able to pass as a converter parameter the current cell header or name to the converter? Thanks for your help.

 

Lou
Top achievements
Rank 1
 answered on 10 Dec 2010
5 answers
142 views
I'm getting the error with a fresh installed machine (Windows 7) with a fresh install of Visual Studio 2010 Ultimate. My question is has anyone tried to install the WPF controls without having an earlier version of Visual Studio on the PC like VS 2008.

I ask this question because we took the same image I have (Windows 7) and added Visual Studio 2008 to the PC then added Visual Studio 2010 and the Install and controls from telerik work fine.

On my VS 2010 only I don't have some of the .net files like net 3.5 is not there just the major version ( IE 1.0, 2.0, 3.0 and 4.0) but there is no net 3.5 like on the VS 2008/VS 2010 machine.

I can't add any controls to the design space without getting the error. I hate to reimage my PC and add VS 2008 just to get the telerik controls to load.
Erjan Gavalji
Telerik team
 answered on 10 Dec 2010
3 answers
92 views
Hi,

I have started developing an application using the RadControls for WPF framework and have noticed that the performance of the docking and map controls aren't very good.  When I drag the docking windows they are slow to respond to my mouse moves.  The map is also also slow to respond to my panning actions in that the map is trailing quite a bit my mouse moves.

I don't have much in my application.  Just the ribbon with 3 tabs and 1 group each (at the moment), the rad docking with a map in one of the panes and two other panes with Rad grids without any rows.

I am running a Core i7 so it should be fairly snappy, certainly if VS2010 is any indication of how fast a WPF application can be.

Cheers,
Clint

Evgenia
Telerik team
 answered on 10 Dec 2010
2 answers
69 views
I'm dragging and dropping from two different listboxes. This works perfectly in Windows7.  However, one of my clients who is on XP can't get this to work.  

I've loaded up an XP VM and sure enough, it doesn't.  I added some logging and found that in the DropInfo handler, DropImpossible is being passed in as the Status when they let go of the mouse on top of the control. When hovering over the control with the mouse down, it is passing DropPossible.  However, it will not pass DropComplete upon release.

If you need me to set up a simple project as an example, let me know.

On a related note, the DragCue is not showing in XP as well.  This may or may not be related. I set the e.Options.DragCue to a TreeViewDragCue in the DragInfo for DragStatus.DragInProgress.
Jon
Top achievements
Rank 1
 answered on 10 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?