DropDownTree - Server-side Events

  • Fuller

Event log

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

RadDropDownTree introduces the following server-side events for working with entries:

  • EntryAdded occurs when the user clicks/checks one of the tree nodes and closes the drop down
  • EntryRemoved occurs when the user clicks/unchecks one of the tree nodes and closes the drop down. In single selection there should be already added entry.

This example shows how the EntryAdded and the EntryRemoved events can be wired up.

Please review the source code of this example for additional details. Keep in mind that AutoPostBack property should be set to True.

  1. Select a DropDownNode and close the drop down to trigger the EntryAdded event
  2. Select another DropDownNode and close the drop down to trigger the EntryRemoved event
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="DropDownTree.Examples.Programming.ServerSide.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<!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>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <div class="demo-container size-thin">
            <telerik:RadDropDownTree RenderMode="Lightweight" ID="RadDropDownTree1" runat="server" AutoPostBack="true" Width="300px"
                OnEntryAdded="RadDropDownTree1_EntryAdded" OnEntryRemoved="RadDropDownTree1_EntryRemoved"
                DataFieldID="EmployeeID" DataFieldParentID="ReportsTo" DataTextField="LastName"
                DataSourceID="SqlDataSource1" DefaultMessage="Please select">
        </telerik:RadDropDownTree>
            <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                SelectCommand="SELECT * From Employees"></asp:SqlDataSource>
        </div>
        <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true" />
    </telerik:RadAjaxPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?