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

Binding DragTooltipText

5 Answers 179 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
4mori
Top achievements
Rank 1
4mori asked on 29 May 2010, 01:42 PM
DEFINE TEMPLATE

        <DataTemplate x:Key="MiaSubCategoria">
            <StackPanel Orientation="Horizontal">
                   <TextBlock Text="{Binding Nome}"/>
            </StackPanel>
        </DataTemplate>
        
       <HierarchicalDataTemplate x:Key="MiaCategoria"
                                 ItemTemplate="{StaticResource MiaSubCategoria}"
                                 ItemsSource="{Binding SubCategorie}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Nome}"/>
            </StackPanel>
        </HierarchicalDataTemplate>

 
SET TREEVIEW:

      <telerikNavigation:RadTreeView Canvas.Left="62" Canvas.Top="25" Height="137" Name="RadTreeView1" Width="486"  IsSingleExpandPath="True" TextDropAfter="Dopo" TextDropBefore="Prima" TextDropIn="In mezzo a" AllowDrop="True" IsDragDropEnabled="True" HorizontalContentAlignment="Stretch" IsExpandOnDblClickEnabled="False" IsExpandOnSingleClickEnabled="True" ItemTemplate="{StaticResource MiaCategoria}"/>


VB CODE FOR POPULATING TREE

Dim
miacollez As ObservableCollection(Of Categorie)

 

miacollez =

New ObservableCollection(Of Categorie)(MyEDM.Categorie.Include("SubCategorie"))

 

 

Me.RadTreeView1.ItemsSource = miacollez

 

 


Hi, I need clarification on how to handle correctly the label called DragTooltipText because I can not set the field name but I associate the name of dataobject (look image in attach). I tried with the styles but does not work .. I can only change colors but the content changes runtime clearly as I do?

Thanks for your cooperation

Marcello

PS: Sorry for my english

5 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 02 Jun 2010, 04:41 PM
Hi Marcello,

I couldn't reproduce the issue. Can you please take a look at the attached project and let me know if it works for you. Also, if the project doesn't illustrate your scenario correctly, can you please modify it accordingly.

Thank you in advance.

Regards,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
4mori
Top achievements
Rank 1
answered on 04 Jun 2010, 09:32 AM

Ciao ...and thanks for your support,
I have merged the two post giving simultaneously responding to both.
I have produced an extract of the problem by simplifying to the Max.
I believe that everything is due to the dialogue between RADCONTROL and Entity Data Model.

Notice that the DragTooltipText does not appear correctly.
And I also manage the DragTooltipText avoiding that appear, when for example I drag from one level to another or when I drag mode "INSIDE" where has been disabled. In fact I tried to use the DragEnter or DragLeave event to prevent certain conditions but unfortunately it doesn't work.
How can you decouple the management of DragToolTip and how is associated in a manner consistent with the DB.


Grazie

Marcello

my example: http://www.softgroup.it/public/radtreeEDM.zip
0
Tina Stancheva
Telerik team
answered on 09 Jun 2010, 05:58 PM
Hi Marcello,

I noticed that you are using an older version of our controls and this is causing the problem with the DragCue. Please download the latest binaries from the Download section in your account and test the project with them.

Also, I noticed that the RadTreeView is databound to a non observable business collection and that is causing some problems with the Drag and drop. For example, you cannot properly drag the items from one node to another.
In order to use the DragAndDrop functionality of the RadTreeview you will need to use an collection that implements INotifyCollectionChanged, like ObservableCollection. Please consider creating a wrapper collection for your database data that can be used as an ItemsSource for the RadTreeView.

Please let us know if we can further assist you.

All the best,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
4mori
Top achievements
Rank 1
answered on 09 Jun 2010, 08:51 PM
Ciao Tina,

I have the latest version downloaded (2009.1 526 (May 26, 2009)) from my account and is the same as example, there is a different version? I am very disappointed I was expecting a more efficient and flexible. If I knew who had these limitation I would have done prior to optimize than Microsoft TreeView control. At least one Microsoft work all events here in drag and drop are enabled only 4 events ...very sad. I purchased a control for faster but I lost too much time to understand what could be done ...sob sob
forgive me for my outburst

Marcello
0
Tina Stancheva
Telerik team
answered on 15 Jun 2010, 12:26 PM
Hi Marcello,

I am really sorry to hear about your disappointment.

The issue with the DragPreviewTooltip you encounter with the 2009.1 526 .dll versions are solved in the new version of our controls. You can test the new DragAndDrop functionality of the RadTreeView in the attached project:WpfEDM_2010_1_603.35 where I used our latest WPF binaries - 2010.1.603.35. In this version of the controls the DragPreviewTooltip uses the ItemTemplate set to each dragged item to determine what to display.

However, I also updated the project you sent by overriding the ToString() method of the business classes so that it can return Name. In the 2009.1.526 version of the controls the ToSting() method of the displayed business object is used to determine what to be displayed in the DragPreviewTooltip.

I also added a new property to the Categorie class - SubCategories as ObservableCollection(Of SubCategorie) and modified the LoadDB method to populate this observable collection. I made this modification because the EntitiCollection SubCategorie doesn't implement INotifyCollectionChanged, which was causing issues with the drag and drop. You can also take a look at this help article describing how to bind the RadTreeView to a WCF service and to Ado .NET data service.

Also I commented the PreviewDragEnded, DragEnded and PreviewDragStarted event handlers so that you can see the default DragAndDrop functionality of the RadTreeView.

Please find attached a project with the 2009.1.526 version of the controls as well as one with the 2010.1.603.35. Give them a try and let me know if they work for you or if your scenario requires a different approach.

Also, you said you need to apply certain limitations to the drag ad drop functionality, so if you encounter any issues, please elaborate on your scenario requirements and we will be more than happy to provide you with a more suitable solution.

Also you can take a look at the Help article on the DragAndDrop functionality of the RadTreeView and also at this demo.

If you need further assistance we will be more than happy to help.

Best wishes,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
4mori
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
4mori
Top achievements
Rank 1
Share this question
or