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

FindControl in NodeDataBound

3 Answers 101 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Kevin Neumann
Top achievements
Rank 1
Kevin Neumann asked on 17 Dec 2011, 03:47 PM
I am wondering if FindControl on the NodeDataBound is an upcoming feature? Or is it has been replaced with something else that I am missing?  I expected to be able to do e.Node.FindControl to find a control in my ItemTemplate but have not been able to do so yet.  A simple reasoning behind the need for this could be tied to the Soccer/Football example.  Say you wanted an image in the ItemTemplate of a Star that was only visible if the player was a team captain or something along that line.

3 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 21 Dec 2011, 12:33 PM
Hi Kevin,

For the next service pack the FindControl method of the GroupItem will be available. E.g. :

void RadOrgChart5_GroupItemDataBound(object sender, Telerik.Web.UI.OrgChartGroupItemDataBoundEventArguments e)
{
 
    var label = e.Item.FindControl("Label1")
}

The template is applied to the GroupItem,  that is why the find method is applied to it too.

Greetings,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Sampath
Top achievements
Rank 1
answered on 02 Jun 2014, 06:34 AM
Will the findcontrol method be available to NodeDataBound as well?
0
Shinu
Top achievements
Rank 2
answered on 02 Jun 2014, 07:24 AM
Hi Sampath,

Please try the following C# code snippet to access the ItemTemplate Control in OnNodeDataBound event of RadOrgChart.

C#:
Label lblControl = e.Node.GroupItems[0].FindControl("Label1") as Label;

Thanks,
Shinu.
Tags
OrgChart
Asked by
Kevin Neumann
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Sampath
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or