Events for row expanding/expanded and collapsing/collapsed

10 posts, 0 answers
  1. Sirajudeen
    Sirajudeen avatar
    3 posts
    Member since:
    Aug 2010

    Posted 06 Aug 2010 Link to this post

    Hi,

    I am using Telerik TreeListView (from Q2 2010) to display hierarchical data. It has few columns also.
    The tree is populated with three levels of data. While expanding and collapsing the node/row, it takes long time.
    So I would like to display some wait control to notify the user that the tree is processing something.
    But I am not able to find any such events fired from the TreeListView control

    It makes more sense to have such events. So please let me know how I can acheive this.
    I desperately in need of a solution for this issue.

    Thanks in advance.

    -Siraj.
  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Aug 2010 Link to this post

    Hello Sirajudeen,

     After 2010.Q2 we added the RowIsExpandedChanged event, which should suit your needs. You can find it in one of the more recent Internal Builds. This will also land in the SP1 release, which is due this week. 

    All the best,
    Yavor Georgiev
    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
  3. DevCraft banner
  4. Sirajudeen
    Sirajudeen avatar
    3 posts
    Member since:
    Aug 2010

    Posted 09 Aug 2010 Link to this post

    Hello Yavor,

    Thanks for your promp response.
    Is there any event just before expanding or collapsing? Because I would like to dislay some wait control while the tree is expanding/collapsing.

    I tried setting DataLoadMode=Asynchronous. But it crashes the application intermittently. So I am looking for an alternate to this behaviour.

    Please suggest me how I can acheive the same.

    Thanks,
    Siraj.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 10 Aug 2010 Link to this post

    Hello,

     You can implement the child data retrieval logic in your view model asynchronously and bind some boolean property to the treelistview IsBusy or set directly IsBusy. For example:


    public class Customer
    {
         ObservableCollection<Order> _Orders;
         public ObservableCollection<Order> Orders
         {
              if(_Orders == null)
              {
                  YourViewModel.IsLoading = true;
                  // your code to retrieve Orders for this customer asynchronously. 
               }
              return _Orders;
         }
    }

    <telerik:RadTreeListView ItemsSource="{Binding Customers}" IsBusy="{Binding IsBusy}" ...

    Best wishes,
    Vlad
    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
  6. Sirajudeen
    Sirajudeen avatar
    3 posts
    Member since:
    Aug 2010

    Posted 10 Aug 2010 Link to this post

    Hello Vlad,

    Thanks for your valuable suggestion.
    Here my problem is not about data loading. It is about the time delay while expanding/collapsing the tree nodes in the TreeListView.
    The data would have been already loaded at this point.

    So I would like to notify the user that the tree is processing something when the node is being expanded/collapsed. If I can handle such events, I can set the IsBusy property as you mentioned in your reply. But I am not able to find any such events in that control.

    Is there any events whenever we expand / collapse a node in the TreeViewList? Or please let me know if there is any other workaround for this issue.

    In my opinion, having events for expanding and collapsing nodes in a tree control, makes more sense.

    Thanks,
    Siraj.
  7. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 13 Aug 2010 Link to this post

    Hello Sirajudeen,

     Based on your input, we have added a RowIsExpandedChanging event on RadTreeListView and RadGridView, which fires before the hierarchy is expanded or collapsed. This gives you the ability to cancel the operation and change the data that is going to be loaded. Also, if you set DataLoadMoade to Asynchronous, and set IsBusy=true in RowIsExpandedChanging and then IsBusy=false in RowIsExpandedChanged, the busy indicator will show up during the data load operation.

    I know you said DataLoadMode=Asynchronous crashes your application earlier in the thread, but if you don't set it, the data will be loaded in the UI thread, so even if you set IsBusy to true, the busy indicator won't show, because the thread will be locked during the data load operation.

    You can find these new updates in next week's Internal Build.

    Sincerely yours,
    Yavor Georgiev
    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
  8. Halász Levente
    Halász Levente avatar
    21 posts
    Member since:
    Feb 2010

    Posted 19 Aug 2010 Link to this post

    I have the code bellow 

    <telerik:RadTreeListView 
                            x:Name="radTreeListView"
                            ItemsSource="{Binding TellerServices, Converter={StaticResource assignedServiceConverter}}"                        
                            AutoGenerateColumns="False"
                            IsReadOnly="True"
                            SelectionUnit="FullRow"
                            telerik:StyleManager.Theme="Windows7"
                            Style="{StaticResource DraggableRadTreeListView}"
                            RowIsExpandedChanged="radTreeListView_RowIsExpandedChanged"
                            >
     
        <telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}"/>
        </telerik:RadTreeListView.ChildTableDefinitions>
     
        <telerik:RadTreeListView.Columns>
        ...   
        </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>

    The problem is that the RowIsExpandedChanged  doesn't fire, no matter what I do.
  9. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 19 Aug 2010 Link to this post

    Hi Halász Levente,

     There were some issues with the initial implementation, which precluded RowIsExpandedChanged from firing on RadTreeListView under certain scenarios. Could you please try with our Latest Internal Build, where this issue is resolved?

    Kind regards,
    Yavor Georgiev
    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
  10. Halász Levente
    Halász Levente avatar
    21 posts
    Member since:
    Feb 2010

    Posted 19 Aug 2010 Link to this post

    I'm using the latest available trial version as for the moment we are evaluating your product. I don't think  I have access to internal builds.
  11. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 19 Aug 2010 Link to this post

    Hi Halász Levente,

     Trial users get to sample all the perks our customers enjoy, including access to internal releases. Please check your account page. You will be able to find the fix I mentioned in the trial internal build that is scheduled to be released tomorrow.

    Kind regards,
    Yavor Georgiev
    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
Back to Top
DevCraft banner