This is a migrated thread and some comments may be shown as answers.

Set Label in ItemTemplate from CellValueChanged

1 Answer 13 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sébastien
Top achievements
Rank 1
Sébastien asked on 29 Jul 2016, 03:08 PM

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.

 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 03 Aug 2016, 11:17 AM
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.
Tags
Grid
Asked by
Sébastien
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or