Hi,
I am using the control Infragistics.Win.UltraWinTree.UltraTree to display xml nodes in to the GUI.and using object of the class Infragistics.Win.UltraWinTree.UltraTreeNode to add child nodes and siblings their parent nodes to display into GUI.
I am using object of the class System.xml.XmlDocument to load XML file.
If data(properties) of particular node will be storing into structure array for later point of use. For example : Element properties: Name, Type, MatchCreterion, DataStruct, Mandatory, Return are storing into structure object array. and will use laterEg: <ElementList> <Element> <Name>MSC</Name> <Type>String</Type> <MatchCreterion>Prefix</MatchCreterion> <DataStruct /> <Mandatory>True</Mandatory> <Return>Yes</Return> </Element> <Element> <Name>SME</Name> <Type>String</Type> <MatchCreterion>Prefix</MatchCreterion> <DataStruct /> <Mandatory>True</Mandatory> <Return>Yes</Return> </Element> </ElementList>Using for loop to add child nodes to their parent node. (Creating TreeNode objects and adding into their parent nodes).
Issue is Here:
If I am trying to load 10 MB xml file, it is taking 20 minutes time to load that file and CPU usage 100% for loading that file. After that system is becoming very slow.
Please provide the solution.
Its very important for my application.
Thank you for your time.
RegardsPrathap Reddy U
prathap_u said:1) Can we edit the cell (UltaTree Control)?
Yes, you need to set the CellClickAction (on the Override) and also AllowCellEdit to enable editing.
prathap_u said:2) Can we populate dynamic values(ComboBox) some of cells in a row (UltaTree Control)?
I'm not exactly sure what you mean by "dynamic", but the column has a ValueList property whcih you can use to provide a dropdown list in a cell.
prathap_u said:2) Can we delete the row/rows(UltaTree Control)?
There's an AllowDelete property on the Overrride, just like AllowCellEdit.
prathap_u said:3) Can we copy and paste the multiple rows(UltaTree Control)?
There is no built-in copy and paste support for nodes in the tree.
You might want to consider using UltraWinGrid instead of UltraWinTree. The grid has support for everything you asked about here, including copy and paste.
Hi Mike,
I followed one approach to load large XML in very less time.
Converted Large XML into DataSet and binded to UltraTree control. It took very less time to load and display in tabular format(GridView). The attahced JPG file shows the sample view.
I have some queries if choose to use latest version of infragistics controls. The following queries are in the Grid View of UltraTree Control. Can you please reply?
1) Can we edit the cell (UltaTree Control)?
2) Can we populate dynamic values(ComboBox) some of cells in a row (UltaTree Control)?
2) Can we delete the row/rows(UltaTree Control)?
3) Can we copy and paste the multiple rows(UltaTree Control)?
Thank you for your time?
Regards
Prathap
Hi Prathap,
As I said above, the vast majority of the performance issue here appears to be caused by the accessing of the data from the XML document and has nothing to do with adding the nodes to the tree.
I'm not really an expert on reading data from an XML Document in the most efficient way, so I'm afraid I can't help you much there. Perhaps you could post on a more general DotNet programming or Microsoft forum where you could get some better advice.
As far as the Tree control is concerned, there's no built-in functionality to read XML data into the tree. You have to add the nodes manually or bind the tree to a DataSource.
Thank you for your reply.
As per my knowledge adding XML nodes into UltraTree is using for loop. Do you have any other ides to populate XML nodes into UltraTree Control and Do you have any example to load any XML file into UltraWinTree. The look and feel is as Tree structure which i shown in my given example.
Note: The XML file size is not constant. some times file size may be 1GB.
Thanks and Regards
I took a look at your sample and I don't see anything obviously inefficient here as far as the tree is concerned.
However, there are a couple of interesting things I found.
First, you are displaying the elapsed time in minutes. This did not work for me and always returned a 0, because the loading of the data always took less than a minute. I changed it to display the seconds, instead, and every time I run the app, it takes about 30 seconds. So perhaps this is just a difference in the speed of our machines.
The next thing I did was tried to determine how much of the time is taken up by adding nodes to the tree and how much is just walking the XML document. So to test that, I removed the tree from the project and even removed the reference to the WinTree assembly. I deleted all of the code that was referencing the tree or tree nodes.
The results were quite surprising. Without the tree, the code actually takes longer to run. The time jumped up to 40 seconds. I have no idea why this is the case, but it seems to me that the overwhelming majority of the time taken to load the data has is the XML Document code and has nothing to do with the WinTree.