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

RadTreeListView: Indent width on drag and drop

8 Answers 99 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
caleb
Top achievements
Rank 1
caleb asked on 07 Oct 2016, 09:32 AM

Hello there,

 

I've got the Telerik Silverlight UI tools version 2016.2.613.1050 - I've got a problem with the results of a drag and drop event for a RadTreeListView control.  The drag and drop works correctly, the various observable collections have an entity removed and added as needed.  The problem is the indent level of the dropped row.  The indent level is not updating when the entity is moving between folders.  So if I move an entity that as an indent level of 0 to a folder that has an indent level of 3 the result is the row is correctly displayed in the folder with the incorrect indent level.  The indent level is correctly drawn when the folder is collapsed and expanded again or scrolling causes the screen to redraw the row.  How can I get the indent level to set correctly here?  I'm adding the row by updating the appropriate observable collection.  So I'm not doing anything with the visual layer.

Cheers,

Caleb

8 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Oct 2016, 12:07 PM
Hello Caleb,

Basically, setting the correct position of the row depends entirely on the implementation of the drag and drop behavior. I suggest you taking a look at the Drag and Drop online example, as it demonstrates how this requirement can be satisfied.

Hopefully, this helps.

Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
caleb
Top achievements
Rank 1
answered on 12 Oct 2016, 01:28 PM

Hello there!

 

Thanks for getting back to me.  I'm using the URL that you referenced extensively in my code.  The major difference being that I have commented out the 'this.AssociatedObject.ExpandAllHierarchyItems();' lines.  If I leave this line in place it causes the RowExpandedChanged event to fire.  This can really eat into the system resources as all the downstream folders fire as well.  Is there a way to position this without using the ExpandAllHierarchyItems() method?

 

Cheers mate,

 

Caleb

0
Stefan
Telerik team
answered on 17 Oct 2016, 10:06 AM
Hello Caleb,

Thank you for clarifying this.

In order to avoid expanding all hierarchy items, you can benefit from the ExpandHierarchyItem method of RadTreeListView. Thus, you should be able to manipulate which exact item to be expanded. Respectively, through the CollapseHierarchyItem method you can collapse it.

In addition, you can take a look at the IsExpandedBinding and IsExpandableBinding topic.

Best Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
caleb
Top achievements
Rank 1
answered on 02 Nov 2016, 08:55 AM

Hello there,

I'm reviewing the possible solution that you have outlined; using the ExpandHierarchyItem() method.  I'm not having any success with the method.  I've got class variable of the destination row that is being set by the OnDrop method in the example that you have made reference to (Drag and Drop).  In the MoveItem method I'm calling this.AssociatedObject.ExpandHierarchyItem(destinationRow); - No results.  I've also tried destinationRow.GridViewDataControl.ExpandHierarchyItem(destinationRow); - No joy.

 

Any thoughts?  Can you put together an example that uses .ExpandHierarchyItem(object) so I can see how it's called?

Thanks so much,

Caleb

0
Stefan
Telerik team
answered on 04 Nov 2016, 02:03 PM
Hi Caleb,

With the provided information I can only guess what the root of the problem on your end is. I am attaching a sample application demonstrating how the desired behavior can be implemented. You should be able to see that in the MoveItem method of the DraDropBehavior I am calling the ExpandHierarchyItem method with the target item and the control behaves as expected. Can you please check it out?

Hopefully, this helps.

Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
caleb
Top achievements
Rank 1
answered on 17 Nov 2016, 11:58 AM

Hello there,

Thanks for the excellent example.  I was able to use it to verify an interesting observation.  I took the code from the sample and compiled it up.  It worked as expected.  I also commented out the .ExpandHierarchyItem(object) line and the code still worked.  I then took the code from the sample and dropped it into my application and the problem was re-introduced!  So I'm guessing that it has something to do with an inherited implicit style.  Can you assist me in what I should look for?  I'm quite sure this is not a code or data binding issue.

Thanks so much,

Caleb

0
Stefan
Telerik team
answered on 22 Nov 2016, 10:56 AM
Hello Caleb,

As the problem is not reproduced by default by the control, but in the particular application only, I am afraid that I can only guess what the cause for it is. Since you assume that it roots in an inherited style, you can use an inspecting tool as XAML Spy, for example, and try locating the customization that causes the reported behavior.

Best Regards,
Stefan X1
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
caleb
Top achievements
Rank 1
answered on 29 Nov 2016, 12:06 PM

Hello there,

 

I've been doing a bunch of cleanup work to the application.  As part of this process I'm moving towards using Themes/implicit styles.  I can't duplicate the problem anymore!  This is a bit frustrating as I always like to understand the issue.  but I'm not going to go digging through SVN to get the error to occur so I can figure it out.

Problem solved.

Thanks for your help on this,

Caleb

Tags
TreeListView
Asked by
caleb
Top achievements
Rank 1
Answers by
Stefan
Telerik team
caleb
Top achievements
Rank 1
Share this question
or