RadTreeListView.ScrollIntoView doesn't works

14 posts, 1 answers
  1. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 05 Jul 2011 Link to this post

    Hi,

    I faced with a problem that RadTreeListView.ScrollIntoView() doesn't works at all.

    I need your support or workaround if so exist asap.

    Thank you in advance,
    Julian
  2. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 05 Jul 2011 Link to this post


  3. UI for WPF is Visual Studio 2017 Ready
  4. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 06 Jul 2011 Link to this post

    Hi again.

    Let me provide you with exact steps that I'm trying to perform:

    1. Select any item in the RadTreeListView hierarchy.
    2. Store selection item (we have to know which item has been selected)
    3. Perform changes on related data of selected item of the RadTreeListView (From one side of UI we have RadTreeListView and from other one related control with some info of selected item).
    4. When changes has been performed - reload the data in RadTreeListView and select the item that was previously edited.

    How to solve it ?

    Julian.
  5. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 06 Jul 2011 Link to this post

    Would you please answer with any kind of feedback ?

    regards,
    Julian
  6. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 07 Jul 2011 Link to this post

    Hello Julian,

    Generally radTreeListView.ScrollIntoViewAsync(item) should do the job.
    If this doesn't help, please send me a small sample project which I can debug on my side in order to see what is going on?
    Thank you in advance.

    Greetings,
    Nedyalko Nikolov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  7. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 08 Jul 2011 Link to this post

    Hi,

    Well, let me shine a little bit more light on my problem.

    Assume that I have the following code:

                this.radTreeListView.SelectionChanged += (s, e) =>
                    {
                        if (this.radTreeListView.SelectedItem != null)
                        {
                            var yamlItem = this.radTreeListView.SelectedItem as YamlItem;
                            if (yamlItem != null && yamlItem.Type != SignalType.Subsystem)
                            {
                                // store selected item into variable
                                this.storedSelectedItem = this.radTreeListView.SelectedItem;
                            }
                        }
                    };

    Let's also assume that when collection of RadTreeListView is going to be changed we have to re-select the last selected item that we stored in local variable this.storedSelectedItem.

                this.radTreeListView.Items.CollectionChanged += (s, e) =>
                        {
                            this.radTreeListView.ScrollIntoViewAsync(this.storedSelectedItemnull);
                        };

    Of course It doesn't works, becouse the old collection was replaced by the new collection, and this.storedSelectedItem has another HashCode, that's why this.radTreeListView.ScrollIntoViewAsync(this.storedSelectedItemnull); can't find such item in its collection.

    Well, to solve this issue I would like to foreach throw the all existed items in the this.radTreeListView.Items, and when I find the item  that is equals to my stored item this.storedSelectedItem.SomeTextValue (I will compare these items by string value that has each item) and afterwords I call this method  this.radTreeListView.ScrollIntoViewAsync(this.storedSelectedItemnull);.

    That was my idea how to solve it, but I need your support how to foreach throw the hierarchical data structure of this.radTreeListView.Items.

    Maybe you have another solution how to solve it ?

    Please need your advice ASAP !

    Kind regards,
    Julian

     

  8. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 08 Jul 2011 Link to this post

    Hi Julian,

    The best approach should be if you can use one and the same HashCode for a single item. However iterating through RadTreeListView.Items collection should be easy, just keep in mind that different objects could be returned due to hierarchical nature of the data source. For example:

    Parent1
        Child1
        Child2
    Parent2
        Child3

    Items will have 5 items ordered (Parent1, Child1, Child2, Parent2, Child3).
    Let me know if this doesn't help.

    Best wishes,
    Nedyalko Nikolov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  9. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 11 Jul 2011 Link to this post

    Hi,

    Please provide me with simple example.

    Regards,
    Julian
  10. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 12 Jul 2011 Link to this post

    Dear Support Team,

    Would you be so kind to provide us with working example as soon as possible or/and any status of current issue.

    Thank you in advance,
    Julian
  11. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 13 Jul 2011 Link to this post

    Hi Julian,

    I am sending you a sample project illustrating a possible approach for iterating through the Items collection.
    Let me know whether it corresponds to your requirements. 
     

    Best wishes,
    Maya
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  12. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 14 Jul 2011 Link to this post

    Hi Maya,

    Thank you for solution.

    The last question how to Expand concrete group where selected item is located ?

    Thank you in advance.



  13. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 14 Jul 2011 Link to this post

    Hello Julian,

    Generally, if you want to get the parent item, you can do it only at data level, i.e. you need to have a property for example connecting the parent and child elements. However, depending on your specific settings and requirements, the child items may not be available unless being expanded.  

    Kind regards,
    Maya
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  14. Julian
    Julian avatar
    77 posts
    Member since:
    Dec 2010

    Posted 14 Jul 2011 Link to this post

    Hi Maya,

    I have a property "Parent" in my data model that represent the Parent (Group) of items that are located under the Parent node. The question is how to use ExpandGroup (IGroup group). How to get IGroup according to my SelectedItem that is of type MyCustomDataCollection ?

    I would appritiate if you could help me with that too :)

    Thanks,
    Julian
  15. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 14 Jul 2011 Link to this post

    Hello Julian,

    Please excuse me if I am missing something, but as you are referring to expanding groups, I got a bit confused. Are you referring to a RadGridView or RadTreeListView control ? Generally, there are no groups in RadTreeListView. 
     

    Best wishes,
    Maya
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
UI for WPF is Visual Studio 2017 Ready