New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Dynamic Creation

  • Current Date
    • Year : 2024
    • Month : 4
    • Day : 19
  • Current Time
    • Hours : 3
    • Minutes : 43
    • Seconds : 42

You can programmatically control any property of RadPanelBar at runtime to easily create or manage flexible panelbars on the fly. This example shows how to create a panelbar from scratch and populate it with the current date and time.

All items are created and added to the panelbar in the Page_Load event of the page.

Please review the source code of this example for details.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="PanelBar.Examples.PopulatingWithData.DynamicCreation.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html>
<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" />

     <div class="demo-container size-thin">
        <telerik:RadPanelBar RenderMode="Lightweight" runat="server" ID="RadPanelBar1" Height="200" Width="100%" ExpandMode="FullExpandedItem">
        </telerik:RadPanelBar>
    </div>

    </form>
</body>
</html>

Support & Learning Resources

Find Assistance