Hi together,
we have some performance problems with the UltraWinTree. Populating data nodes collection takes extreme long. From 3 to 15 seconds, depending on the amount of data that is shown, of course.
To the application. It is a financial planning tool for employees manning guides. The image below shows a screenshot of application's tree and how we show that data to the user. As you can see, there are 4 levels of data. We show the positions that exists in a department. Employees can be attached to this positions. Then, every employee has a salary structure (structure is defined by the position and can very from position to position). So there are usually about 16-24 rows for salaries per employee (gray rows). Department sizes vary from 2 to 10 positions. Per Position there are about 5 employees. So we have about 10 * 5 * 24 = 1200 rows in really big departments. Smalls ones have about 200 rows.
Data is bound via data sets with tables and key constraints to the tree. We do all formattings per node in the InitializeDataNode event handler. Formatting takes about 200-300 ms. We can live with that. But populating the data nodes collection takes 3 to 15 seconds. With that, we can't live. To gain performance we set the SynchronizeCurrencyManager to false. We won about 200 ms.
Are there any other tricks to get more performance? Would be great if you can help here. Since the shown structure is the minimum structure we need in the application.
Thanks in advance!
Robin
Hello Robin,
Thank you for your feedback.
Please find bellow answers to your questions:
1) Could you please clarify who and how makes those calculations on your calculated rows? If you are using ADO.NET you probably use Expressions so in this case you should update the underlying data table, but this won’t involves rebinding of your tree. Actually rebinding is “expensive” operation, so you should avoid it, instead just update the underlining data source and UltraTree will reflect those changes.
2) Adding a new row to a particular table in your data set does not rebind entire tree. Please check attached my revised sample solution where I have add similar functionality. By clicking the Add Row button you can add a row to the underlying data table and it appears in the tree.
If you could provide us simple sample which demonstrates your issue or to modify my sample, it will helps me to understand better your issue.
Please let me know if you have any further questions.
Hi Milko!
Thanks a lot for your answer and the tips! We are heavily working on it and evaluate your suggestions. Problem is, that we have to deliver asap to the customer. So we are working on the product while evaluating your suggestions. That's why I did not answer the last day.
Lazy loading sounds good. I'll have a look on it from now. Regarding this, I have some further question. In hope, that you can give me some further hints since I cannot find Best Practices in your documentation. Maybe you can guide me to the correct websites. So here are the problems:
1. The user works in the tree and edits values. There are rows (e.g. the employee benefits) that depend on the changed values. So we like to update the calculated rows while the user is typing. Do you have some best practices for requirements like that regarding the tree? How to update the data table rows and prevent the tree from complete rebuild?
2. The user can add employees to positions. We do that by adding the new rows to the appropriate data tables. But if we do so, the tree rebuilds completely. The user defined view (expanded/collapsed nodes) goes away because the tree is rebuilt. How can this be handled?
Hopefully, you have some solutions for me, I am looking forward to your answer!
I will respond to your last answer and mark it as solution, if it helps in some way. But for this, I have to try the lazy loading stuff now. :)
Many thanks in advance!
I have checked your ManningGuideTreeFormatter class where you have put all the formatting logic. I saw that you set up the appearance of the cells on many places as well as their functionality. In order to speed up the loading of the tree please consider these two points:
Consider reusing of all the Appearances you are creating. Please check this article, more specifically point 2) Re-use Appearances http://ko.infragistics.com/community/forums/t/15306.aspx
If I understand correctly when first displayed all the nodes of your tree are collapsed. Please try to implement lazy loading of tree nodes. There is a sample in our samples showing how to achieve this. If during installation of Infragistics Controls you have install the samples it should be in Program Files, Infragistics (NetAdvantage) directory in this subfolder “\Windows Forms\Samples\Tree\CS\UltraTree Load On Demand CS”. If you implement this logic you will have not more than 20 nodes loaded in the same time, and this should be almost instantly.
Please let me know if you need any further assistant.
I've deactivated all formatting actions. For data nodes as well as for column sets. But it takes still 1-3 seconds, 5 seconds for a big department. Time goes somewhere and I don't know where... For now. :)
I forgot an important point. We use some hidden columns in the tree for IDs. So every month has its own ID column. So imagine you change a figure for one employee in e.g. march. Then we take the id for this particular value from the hidden id column for march. With that id we can save the particular value at our server.
We need this because every month has some more value. Consider planning with hours and cost per hours rather then with one nominal value. So the particular monthly value is a little bit more complex. That's why we have a business object for such a "PlanningValue". And the id I mentioned above is exactly for the PlanningValue object.
But this PlanningValue objects are not bound to the tree in any way. That's what's behind the (UI) scenes.