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

Nested Datepicker in Panel Bars

1 Answer 71 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Josh McDermott
Top achievements
Rank 1
Josh McDermott asked on 20 Oct 2010, 03:28 AM
When I use the javascript below on a regular page without panel bars, the code below works just fine.

var picker = $find("<%= datDueDate.ClientID %>");

picker.set_enabled(false);


However, when I use this code on a datepicker nested in radpanelbars, it does not work.  How can I enable/disable a datepicker that is nested in radpanelbars?

Thank you in advance.

Josh

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Oct 2010, 06:33 AM
 Hello Josh,

The following code snippet shows how to disable RadDatePicker inside RadPanelBar from client side.

ASPX:
<telerik:RadPanelBar ID="RadPanelBar1" runat="server">
            <Items>
                <telerik:RadPanelItem Text="ColorPicker">
                    <ItemTemplate>
                        <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
                        </telerik:RadDatePicker>
                    </ItemTemplate>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>

JavaScript:
function disable()
    {
        var datePicker = $find('<%=RadPanelBar1.FindItemByText("ColorPicker").FindControl("RadDatePicker1").ClientID%>');
        datePicker.set_enabled(false);
        return false;
    }

And please refer the following documentation which explains how to access the control inside Template.
Accessing Controls Inside Templates

Thanks,
Princy.
Tags
Calendar
Asked by
Josh McDermott
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or