Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Input / Within Grid

TitleNameHire dateAge 
 
Mrs. Jane Brown Thursday, December 25, 2003 25
Mr. Peter Johnson Wednesday, August 22, 2001 45
Ms. Diane Klive Wednesday, April 14, 1999 23
Mrs. Megan Hammer Wednesday, November 5, 1997 31

  • RadInput controls are seamlessly integrated within ASP.NET DataGrid control like RadGrid. You can embed it in the edit template of your template columns and use it for inline editing or auto-generated edit forms editing.

    Additionally, you have the options to either use built-in columns for numeric, datetime or masked input or inputify the standard textbox editors using RadInputManager.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.InputExamplesCS.Common.DataGrid.DefaultCS" %>

    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ 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">
        <qsf:HeadTag ID="Headtag1" runat="server"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="mainForm" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="C#" ShowSkinChooser="true">
        </qsf:Header>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnUpdateCommand="RadGrid1_UpdateCommand"
            OnNeedDataSource="RadGrid1_NeedDataSource" AllowSorting="true">
            <ItemStyle HorizontalAlign="Center" />
            <AlternatingItemStyle HorizontalAlign="Center" />
            <HeaderStyle HorizontalAlign="Center" />
            <MasterTableView EditMode="InPlace" DataKeyNames="ID">
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="Title" SortExpression="Title">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "Title") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadMaskedTextBox ID="titleTextBox" Width="60px" runat="server" Skin="Web20"
                                Text='<%# Bind("Title")%>' Mask="<Mr.|Mrs.|Ms.|Dr.>" PromptChar="_">
                            </telerik:RadMaskedTextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Name" SortExpression="Name">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "Name") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="nameTextBox" runat="server" Skin="Web20" Width="100px" Text='<%# Bind("Name")%>'>
                            </telerik:RadTextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Hire date" SortExpression="HireDate">
                        <ItemTemplate>
                            <%# ((DateTime)DataBinder.Eval(Container.DataItem, "HireDate")).ToString("D")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDateInput ID="birthdayPicker" runat="server" Skin="Web20" Culture="(Default)"
                                DbSelectedDate='<%# Bind("HireDate")%>' DateFormat="MMMM/dd/yyyy" MinDate="01/01/1950"
                                Width="120px">
                            </telerik:RadDateInput>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Age" SortExpression="Age">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "Age") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox Width="60px" ID="workedYears" runat="server" Skin="Web20"
                                DbValue='<%# Bind("Age")%>' Type="Number">
                            </telerik:RadNumericTextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateText="Update" CancelText="Cancel"
                        EditText="Edit" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <!-- content end -->
        <qsf:Footer ID="Footer1" runat="server"></qsf:Footer>
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451