Retaining the expansion in RadGridView

2 posts, 0 answers
  1. Prakash
    Prakash avatar
    19 posts
    Member since:
    Oct 2010

    Posted 14 Feb 2012 Link to this post

    Hi Team,

    I'm in need of a small issues, and issue is retaining the expanded row in RadGridView with RadTreeListView.

    I've a RadGridView inside that I've placed a radtreelistview. so it will show three level hierarchy. 
    Each grid row contains radtreelistview and selecting a grid row shows radtreelistview for that particular row with all child row in collapsed state. on selecting row from radtreelistview, shows it's child row. 

    Now, I've a refresh button to refresh the data whenever required. so, when user refresh the data I need to retain the expanded rows as it was before refreshing. What way I can achieve this. 

    Right now, I'm iterating all rows in the grid and selecting the rows which are expanded and storing it in a list. once data loaded after refresh, I'm iterating the rows in the list and rows in the grid and expanding the matched rows. but I want to know is this the right way to do since if it going to have 1000 rows or more than that means iterating will be performance issue. Please provide an idea on this case.

    One more thing, I want to know how to get the expanded rows from RadTreeListView which inside the grid view row and how to set the expansion back  to RadTreeListView.

  2. Nedyalko Nikolov
    Nedyalko Nikolov avatar
    871 posts

    Posted 17 Feb 2012 Link to this post

    Hi Prakash, 

    You can use Expanded changed event (or RowDetailsVisibilityChanged event) in order to store the information about expanded state for a particular item and then RowLoaded event to expand row for this data item. You can use the same approach for RadTreeListView too.

    All the best,
    Nedyalko Nikolov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top