Load Childs on collapsing Row in RadGridView

4 posts, 0 answers
  1. Flo
    Flo avatar
    2 posts
    Member since:
    Apr 2012

    Posted 26 Apr 2012 Link to this post

    Hi

    I'm new to the Telerik Libs.
    I rewriting a program to use the Telerik Libs.

    The Program should show the strucure of a CAD Structure as a "TreeListView". My Problem is that NOT the complete structure is loaded on startup. So it's only the first level loaded. The other data are laoded, when the tree is collapsed.

    So I'm using the GridView as a SelfReference to have the Tree View.

    The Problem is how can I show the "+" Icon even if I only loaded the first level. On loading the first level I know if there a sub Items or not.
    I have tried it with Me.RadGridView1.Rows(rownum).HasChildRows = True but thats readonly.

    And the next thing is, how can I react on collapsing the tree, and reload the sub items

    Thanks
    Br Flo

    PS: I'm using VB.net ad VS2010
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 30 Apr 2012 Link to this post

    Hi Florian,

    The most suitable solution for your scenario is to use RadTreeView with load-on-demand data loading instead of the RadGridView control in self-reference mode. To control the visibility of the expander icon ('+')
    depending on the existence of children items, you can set the LazyMode property to False.

    I hope this helps.

    All the best,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. Flo
    Flo avatar
    2 posts
    Member since:
    Apr 2012

    Posted 02 May 2012 Link to this post

    Hi Julian

    Thanks for your answer.
    The Problem is that I need a lot of additional columns. So I wanted to use the GridView Control.
    With the TreeView I don't' have the additional columns.

    I'm thinking about a workaround.
    Loading the first level. And where I need '+' I create a dummy entry.
    When the user clicks on the '+', I delete the dummy entry and load the childs.

    Which event do I have to use to react on the collapse?

    Maybe you should think about the load-on-demand feature also for the DataView Control.
  4. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 04 May 2012 Link to this post

    Hello Florian,

    You can use ChildViewExpanding or ChildViewExpanded events for this behavior.

    I hope this helps. 
     
    Greetings,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top