Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am pretty new to the C# and Windows world. I am a Unix guy but started learning C#.NET for a critical project requirement.
With the help of Google and Stackoverflow, I was able to complete 70% of the work. But this is critical.
I have two Tree views populated from XML files. I have them loaded side by side in a windows form.
treeView1 and treeView2. I need to compare these two treeviews and highlight any difference in any of the nodes. I am using C#.NET Visual Studio 2012 professional.
[b]treeView1 [/b]
BIOS_DETAILS
-Manufacturer
-- Hewlett Packard
-Name
-- Default SystemBIOS
-PrimaryBIOS
-- TRUE
[b]treeView2[/b]
BIOS_DETAILS
-Manufacturer
-- Hewlett Packard
-Name
-- Default SystemBIOS
-PrimaryBIOS
-- FALSE
I need to compare these and highlight the differences in color. Can you please help?
Thanks in Advance.
Posted
Comments
Sergey Alexandrovich Kryukov 7-Aug-14 12:29pm    
To start with, you need to tell us what do you mean by the type "TreeView"? Which one? Do you think there is only one? Full type name, please. More importantly, you need to explain what do you mean by "difference". In your description, it's not fully defined, and this is not as trivial as you may think... What is the tree structures are different? and so on...
As to the showing different color, it highly depend on UI you are using. Pretty simple in WPF and ASP.NET, trickier in Forms...
—SA
gggustafson 7-Aug-14 17:17pm    
May I suggest that you compare the sources of your TreeViews. That way, if there are transcription errors (that is between the XML data and the data displayed in the TreeView) they will not affect the comparison.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900