Assume I have an XML doc with employees and who reports to them. Something like this:
<?xml version="1.0" encoding="utf-8" ?>
<employees>
<employee>
<id>1</id>
<name>Ashley King</name>
<title>Director</title>
<directReports>
<employee>
<id>2</id>
<name>Jim Warden</name>
<title>Manager</title>
<directReports>
<employee>
<id>3</id>
<name>Jeff Reese</name>
<title>Lead</title>
<directReports>
<employee>
<id>4</id>
<name>Leann Thompson</name>
<title>Staff</title>
<directReports />
</employee>
<employee>
<id>5</id>
<name>Amber Herzer</name>
<title>Staff</title>
<directReports />
</employee>
<employee>
<id>6</id>
<name>Ben Lively</name>
<title>Staff</title>
<directReports />
</employee>
</directReports>
</employee>
<employee>
<id>3</id>
<name>Mary Hibdon</name>
<title>Lead</title>
<directReports>
<employee>
<id>50</id>
<name>Brandon Burns</name>
<title>Staff</title>
<directReports />
</employee>
<employee>
<id>55</id>
<name>David Peck</name>
<title>Staff</title>
<directReports />
</employee>
<employee>
<id>62</id>
<name>Ben Lively</name>
<title>Staff</title>
<directReports />
</employee>
</directReports>
</employee>
</directReports>
</employee>
</directReports>
</employee>
</employees>
I'd like to use webforms (c#) to create dynamic org charts based on the data in the xml doc I feed it. I have tried a few methods with varying levels of crappiness.
It seems to me like the solution will have to include an html table (cringe). Mainly because the position of each employee is significant and we can't have them floating around the browser window (please correct me if you disagree). The top employee, Askley King, would be be the top cell, a with a colspan of X. Jim Wardon would be the next row with the same colspan since he doesn't have any contemporaties in that XML doc. Jeff Reese and Mary Hibdon would be the next row with colspans of x / 2. Then, the next row has the next employees and I start to get bogged down in how to complete it.
How would you do it? Code or concept... makes no difference. I just need to be pointed in the right direction.