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

Dynamic Settings

Start date:    End date:
Product ID:1
Category Name:Beverages
Product Name:
Unit Price:
Product ID:2
Category Name:Beverages
Product Name:
Unit Price:
Product ID:3
Category Name:Condiments
Product Name:
Unit Price:
Product ID:4
Category Name:Condiments
Product Name:
Unit Price:

This example shows how to apply setting to TextBox controls with RadInputManager dynamically on server-side.

The DatePickerSettings for the TextBox controls placed outside the repeater are applied within the Page's Init event and the settings for the TextBox controls placed within the ItemTemplate of the Repeater are applied within the OnItemCreated event.

Related Resources

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.InputManager.DynamicInputSettings.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>
    <link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecorationZoneID="demo-container" DecoratedControls="All" ControlsToSkip="Textbox" />
    
    <div class="demo-containers">
        <div class="demo-container" id="demo-container">
            <div class="contentContainer">
                <div class="datesWrapper">
                    Start date:
                    <asp:TextBox runat="server" ID="StartDatePicker"></asp:TextBox>&nbsp;&nbsp;
                    End date:
                    <asp:TextBox runat="server" ID="EndDatePicker"></asp:TextBox>
                </div>

                <div class="listViewWrapper cf">
                    <telerik:RadListView runat="server" ID="RadListView1" DataSourceID="SqlDataSource1" OnItemCreated="RadListView1_ItemCreated">
                        <ItemTemplate>
                            <div class="itemTemplate">
                                <span class="caption">Product ID:</span><%# Eval("ProductID") %><br />
                                <span class="caption">Category Name:</span><%# Eval("CategoryName") %><br />
                                <span class="caption">Product Name:</span><asp:TextBox runat="server" ID="ProductNameTextBox" Text='<%# Eval("ProductName") %>'></asp:TextBox><br />
                                <span class="caption">Unit Price:</span><asp:TextBox runat="server" ID="UnitPriceTextBox" Text='<%# Eval("UnitPrice") %>'></asp:TextBox>
                            </div>
                        </ItemTemplate>
                    </telerik:RadListView>
                </div>

                <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:NorthwindConnectionString %>'
                    SelectCommand="SELECT TOP 4 [ProductID], [ProductName], [UnitPrice], [CategoryName] FROM [Alphabetical list of products]"></asp:SqlDataSource>
            </div>
        </div>
    </div>

    <telerik:RadInputManager RenderMode="Lightweight" runat="server" ID="RadInputManager1">
        <telerik:TextBoxSetting BehaviorID="TextBehavior1"></telerik:TextBoxSetting>
        <telerik:NumericTextBoxSetting BehaviorID="NumericBehavior1"></telerik:NumericTextBoxSetting>
        <telerik:DatePickerSetting BehaviorID="DateBehavior1"></telerik:DatePickerSetting>
    </telerik:RadInputManager>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance