Edit this page

findElement

This method takes control id for an argument and returns the corresponding DOM element of html or rendered server control inside the grid row. Useful to reference html elements of controls inside a grid item cell on the client.

 

findElement(id)
id String The id of a DOM element.

Example:

        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server">
            <MasterTableView> 
                <Columns> 
                    <telerik:GridTemplateColumn> 
                        <ItemTemplate> 
                            <asp:Label ID="Label1" runat="server" /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDataBound="RadGrid1_RowDataBound" />
            </ClientSettings>
        </telerik:RadGrid>
            function RadGrid1_RowDataBound(sender, args) {
                var lbl = args.get_item().findElement("Label1");
                lbl.innerHTML = args.get_dataItem()["LastName"];
            } 
Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy