1: protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
2: {
3: // User has changed the drop down list, so update the orgchart template
4: switch (DropDownList1.SelectedValue)
5: {
6: case "1": XmlOrgChart.ChartItem.HtmlTemplate = @"{name}";
7: break;
8: case "2": XmlOrgChart.ChartItem.HtmlTemplate = @"{name}<br/><B>{JobTitle}</B>";
9: break;
10: case "3": XmlOrgChart.ChartItem.HtmlTemplate
11: = @"<div style='border:solid black;width:175px'>Name:{name}</br>Role:<B>{JobTitle}</B></div>";
12: break;
13:
14: default: XmlOrgChart.ChartItem.HtmlTemplate = null;
15: break;
16: }
17:
18:
19: lblHtmlTemplate.Text = Server.HtmlEncode(XmlOrgChart.ChartItem.HtmlTemplate);
20: // If the user has selected option 3 then do not show the background image
21: XmlOrgChart.ChartItem.ShowBackgroundImage = DropDownList1.SelectedIndex != 3;
22:
23: // Display the chart
24: XmlOrgChart.DataBind();
1: <cc1:XmlBoundOrganisationChart ID="XmlOrgChart" DataSourceID="XmlDataSource1" runat="server" Width="860px">
2: </cc1:XmlBoundOrganisationChart>