Set Label in ItemTemplate from CellValueChanged

2 posts, 0 answers
  1. Sébastien
    Sébastien avatar
    12 posts
    Member since:
    Apr 2016

    Posted 29 Jul Link to this post

    Hi,

    Using the RadGrid in Batch Editing mode and the EditType is set to row. 

    aspx:

    <telerik:GridTemplateColumn UniqueName="2_1" DataType="System.Int32" DataField="2_1" AllowSorting="false">
        <ItemTemplate>
            <asp:Label runat="server" ID="lbl2_1" Text='<%# Eval("2_1") %>'></asp:Label>
            <asp:Label runat="server" ID="lblDay2_1" ClientIDMode="Static"></asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
            <span>
                <telerik:RadNumericTextBox runat="server" ID="tb2_1" Text='<%# Bind("2_1") %>' Type="Number" MinValue="0" MaxValue="999">
                    <NumberFormat DecimalDigits="0"/>                                       
                </telerik:RadNumericTextBox>                                   
            </span>                               
        </EditItemTemplate>
    </telerik:GridTemplateColumn>  

    I want to access the label ""lblDay2_1" client-side to change the text when the user edit the RadNumericTextBox

    I think the best way is to use the event "CellValueChanged" but I am not be able to access the Label "lblDay2_1" to change the text.

    How can I do that? 

    Thanks in advance.

     

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 03 Aug Link to this post

    Hello Sébastien,

    See the help topic below for more information on accessing  controls in batch edit mode:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-batch-edit-mode

    I hope this helps.

    Regards,
    Maria Ilieva
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top