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

finding controls in radtoolbar items

1 Answer 205 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
ldc0618
Top achievements
Rank 1
ldc0618 asked on 22 Apr 2010, 12:29 AM
I have a combox inside a itemtemplate for a RadToolBarButton. Once I have buried the control in the itemTemplate, I can no longer access it in code behind. Is that correct? So the only way I can access the control is to do something similar to:

RadComboBox cmbPresets = (RadComboBox)rtbMenuAdmin.FindItemByText("Preset").FindControl("cmbPresets");

Thanks!

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Apr 2010, 07:13 AM

Hello,

In order to get a reference to the embedded control in ItemTemplate of RadToolBar, locate the RadToolBarItem that has the template, and use its FindControl() method. I think your code works fine.

Here is the documentation describing how to Access Controls Inside Templates.

-Shinu.

Tags
ToolBar
Asked by
ldc0618
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or