populate lable in the grid on combobox selectedindex

2 posts, 0 answers
  1. Rahul
    Rahul avatar
    14 posts
    Member since:
    Feb 2013

    Posted 09 Jun 2014 Link to this post

     I want to populate populate lable in the grid on combobox selectedindex when batchupdating is performed.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Jun 2014 in reply to Rahul Link to this post

    Hi Rahul,

    Please try the below JavaScript code snippet to update the Label inside the RadGrid in OnClientSelectedIndexChanged event.

    ASPX:
    <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
        OnPreRender="RadGrid1_PreRender">
        <MasterTableView CommandItemDisplay="Top" EditMode="Batch">
            <BatchEditingSettings EditType="Row" />
            <Columns>
                <telerik:GridTemplateColumn DataField="OrderID" UniqueName="OrderID">
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="select" OnClientSelectedIndexChanged="SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="Label">
                    <ItemTemplate>
                        <asp:Label ID="lblUpdate" runat="server">
                        </asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    JavaScript:
    function SelectedIndexChanged(sender, args) {
        var row = Telerik.Web.UI.Grid.GetFirstParentByTagName(sender.get_element(), "tr");
        var label = $telerik.findElement(row, "lblUpdate");
        label.textContent = args._item._text;
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top