OrgChart - Edit Employees

Next database reset in 0 hours, 24 minutes, 1 seconds
  • Managment
    • Mario Pontes
      CEO
    • Marketing
      • Yoshi Latimer
        Marketing Director
      • Johan Stromberg
        Brand Manager
    • Sales
      • Kate Wilson
        Sales Associate
  • Add Employee
  • Edit Employee
  • Remove Employee
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

The demo shows how to Add/Edit/Remove employees from a company's structure. In order to achive that functionality we used RadContextMenu and RadWindow controls. Please use context menu (right button click) to show the Add/Edit/Remove options.

  • DefaultCS.aspx
    • DefaultCS.aspx
    • WindowContent.aspx
  • DefaultCS.aspx.cs
    • DefaultCS.aspx.cs
    • WindowContent.aspx.cs
  • scripts.js
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="OrgChart.Examples.ApplicationScenarios.AddEditRemoveEmployees.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <script type="text/javascript" src="scripts.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="dmo-container no-bg">
        <div class="qsf-demo-canvas">
            <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel" Skin="Vista"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1">
                <telerik:RadOrgChart RenderMode="Lightweight" runat="server" ID="RadOrgChart2" Skin="Vista" GroupColumnCount="2">
                </telerik:RadOrgChart>
                <telerik:RadContextMenu runat="server" ID="RadContextMenu1" CssClass="CustomContextMenu" OnClientItemClicked="onClientItemClicked" Skin="Default">
                    <Items>
                        <telerik:RadMenuItem Text="Add Employee" CssClass="rmAdd" Value="Add" />
                        <telerik:RadMenuItem Text="Edit Employee" CssClass="rmEdit" Value="Edit" />
                        <telerik:RadMenuItem Text="Remove Employee" CssClass="rmRemove" Value="Remove" />
                    </Items>
                </telerik:RadContextMenu>
                <telerik:RadWindow RenderMode="Lightweight" runat="server" OnClientClose="onClientClose" VisibleStatusbar="false" AutoSize="true" VisibleTitlebar="false" Modal="true" Behaviors="Close" ID="RadWindow1" NavigateUrl="WindowContent.aspx" Skin="Vista"></telerik:RadWindow>
            </telerik:RadAjaxPanel>
            <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString35 %>" SelectCommand="SELECT * FROM [EditableTeams]"></asp:SqlDataSource>
            <asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString35 %>" SelectCommand="SELECT * FROM [EditableEmployees]"></asp:SqlDataSource>
        </div>
    </div>
    <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
        <script type="text/javascript">
            //<![CDATA[
            Sys.Application.add_load(function () {
                window.orgChart = $find("<%= RadOrgChart2.ClientID %>");
                window.win = $find("<%= RadWindow1.ClientID%>");
                window.ajaxPanel = $find("<%= RadAjaxPanel1.ClientID %>");
                window.contextMenu = $find("<%= RadContextMenu1.ClientID %>");
                demo.initialize();
            });
            //]]>
        </script>
    </telerik:RadCodeBlock>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?