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

possible RadToolbarTemplateButton bug

2 Answers 55 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 21 Oct 2009, 10:08 AM
Need som help.
I am using Telerik RAD Controls Q2 2007 in our AJAX enabled web application. In one of the user controls I am using the a RadToolbar, which contains some  RadToolbarTemplateButtons. These RadToolbarTemplateButtons wrapping around other web controls (asp:DropDownList, rad:RadDatePicker), but these web controls are not accessible from code behind. As I found out none of the web controls inside the RadToolbarTemplateButton are added to the designer.cs files in Visual Studio. The layout in teh markup looks as below:
<radTlb:RadToolbarTemplateButton ID="RadToolbarTemplateButton3" runat="server"
            <ButtonTemplate> 
                <radCln:RadDatePicker ID="dpDatePicker" runat="server" Width="105px" DateInput-ReadOnly="true" 
                    DateInput-Skin="None" Calendar-Skin="Web20" 
                    Calendar-SkinsPath="/" DateInput-SkinsPath="/"
                    <ClientEvents OnDateSelected="BroadcastDateChange" /> 
                </radCln:RadDatePicker> 
            </ButtonTemplate> 
        </radTlb:RadToolbarTemplateButton> 

As you can see all the necessary attributes are present (IDs and such), but none of the content in RadToolbarTemplateButton3 is present in the designer.cs file, thus making it impossible to use the user control and acess the RadToolbarTemplateButton  content.
I already reinstalled VS 2005 and added all the controls to the user controls page from scratch.
If I try to add any controls outside of the rad:RadToolbar they are fine and auto generated in designer.cs correctly. Frankly this is very very annoying as I am not able to use the user control.
thanks for any suggestion and help.

2 Answers, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 26 Oct 2009, 08:00 AM
You need to find the button first (e.g. by using FindButtonByText) and then use the FindControl to find any embedded control in it.
This is how it works on every templated control.
0
Benjamin
Top achievements
Rank 1
answered on 27 Oct 2009, 11:33 AM
yeah you are right. I just used that way and it works, however, it is indeed interesting how the control content is created in the template. thanks
Tags
ToolBar
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
Benjamin
Top achievements
Rank 1
Share this question
or