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

how can i find a control in a footer with javascript

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RRORRO
Top achievements
Rank 1
RRORRO asked on 09 Jul 2010, 04:43 PM
HI
I have a problem, i need to find a label in a footer from 1 grid with javascript

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 13 Jul 2010, 02:33 PM
Hello,

In order to achieve the desired functionality, I recommend that you store the ClientID of the label in a hidden field on ItemCreated of the grid:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridFooterItem)
    {
        GridFooterItem gridFooter = e.Item as GridFooterItem;
        Label label1 = gridFooter.FindControl("Label1") as Label;
        HiddenField1.Value = label1.ClientID;
    }
}
Then, you can easily access the label client-side with the following code:
label1 = document.getElementById(document.getElementById("HiddenField1").value);

I hope this helps.

All the best,
Mira
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
RRORRO
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or