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

Events for row expanding/expanded and collapsing/collapsed

9 Answers 274 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Sirajudeen
Top achievements
Rank 1
Sirajudeen asked on 07 Aug 2010, 03:32 AM
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.

9 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 09 Aug 2010, 11:56 AM
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
0
Sirajudeen
Top achievements
Rank 1
answered on 09 Aug 2010, 06:02 PM
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.
0
Vlad
Telerik team
answered on 10 Aug 2010, 06:38 AM
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
0
Sirajudeen
Top achievements
Rank 1
answered on 10 Aug 2010, 06:27 PM
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.
0
Yavor Georgiev
Telerik team
answered on 13 Aug 2010, 10:51 AM
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
0
Halász Levente
Top achievements
Rank 1
answered on 19 Aug 2010, 07:53 AM
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.
0
Yavor Georgiev
Telerik team
answered on 19 Aug 2010, 08:25 AM
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
0
Halász Levente
Top achievements
Rank 1
answered on 19 Aug 2010, 02:04 PM
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.
0
Yavor Georgiev
Telerik team
answered on 19 Aug 2010, 02:48 PM
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
Tags
TreeListView
Asked by
Sirajudeen
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Sirajudeen
Top achievements
Rank 1
Vlad
Telerik team
Halász Levente
Top achievements
Rank 1
Share this question
or