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

Date Picker inside Toolbar

3 Answers 190 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
John Davis
Top achievements
Rank 2
John Davis asked on 29 May 2008, 06:26 PM

Do you have an example that has 2 date pickers like the DatePicker example at 
http://www.telerik.com/demos/aspnet/prometheus/Calendar/Examples/Overview/DefaultCS.aspx
but the date pickers are inside a toolbar?
I hope the example shows how to initialize dates from code-behind and how to get the dates that have been selected by the user.

I tried to follow that non-toolbar example but I got:

Compiler Error Message: CS0103: The name 'RadDatePickerA' does not exist in the current context

******

  <rad:RadToolBar Width="470px" Height="34px" Font-Size="Smaller" runat="server" ID="tb1"
    Skin="Outlook" usefadeeffect="True" AutoPostBack="True" OnButtonClick="tb1_ButtonClick">
    <CollapseAnimation Duration="200" Type="OutQuint" />
    <Items>
    
     <rad:RadToolBarButton PostBack="false" Value="btnPickA">
    
      <ItemTemplate>
       <label for='<%= RadDatePickerA.DateInput.ClientID + "_TextBox" %>'>
        Start:</label>
       <rad:RadDatePicker ID="RadDatePickerA" runat="server" MinDate="2006-01-01" SelectedDate="2006-12-24"
        SharedCalendarID="SC1" Width="100px">
        <Calendar ID="Calendar1" runat="server" EnableEmbeddedSkins="false" Skin="WebBlue">
        </Calendar>
       </rad:RadDatePicker>
      </ItemTemplate>
      <ItemTemplate>
       <rad:RadCalendar ID="SC1" runat="server" EnableMultiSelect="false" RangeMinDate="2006/01/01"
        EnableEmbeddedSkins="false" Skin="WebBlue">
       </rad:RadCalendar>
      </ItemTemplate>
     </rad:RadToolBarButton>
     <rad:RadToolBarButton AccessKey="r" ImageUrl="~\Images\Refresh.gif" Text="Refresh"
      ToolTip="Refresh (Alt+R)" Width="67px" />
     <rad:RadToolBarButton IsSeparator="true">
     </rad:RadToolBarButton>
     </Items>
   </rad:RadToolBar>

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 30 May 2008, 12:32 PM
Hi John,

You have to remove the following line

<label for='<%= RadDatePickerA.DateInput.ClientID + "_TextBox" %>'>

Hope this helps.


Greetings,
Plamen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shake
Top achievements
Rank 1
answered on 26 Jan 2009, 10:04 AM
Hi telerik team.
 I have the this code on aspx file   for  DatePicker I tried many time using different method but all are in vain.
  <telerik:RadDatePicker ID="rdtAdvancedShip" runat="server">
                                            </telerik:RadDatePicker>
Error    171    The name 'rdtAdvancedShip' does not exist in the current context   
and finding  compilation error.Please tell me what to do.


Regards,
Shakil Ahmed







0
Sebastian
Telerik team
answered on 27 Jan 2009, 09:02 AM
Hello Shake,

If you want to reference control (residing in a template of another control) client-side, you may consider using one of the approaches discussed in these code library threads:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/accessing-server-controls-in-a-grid-template-on-the-client.aspx
http://www.telerik.com/community/code-library/aspnet-ajax/grid/retrieving-grid-editor-value-client-side.aspx

Note that despite they are applied when controls reside inside grid templates, they should be applicable in other scenarios with templates as well.

Regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
John Davis
Top achievements
Rank 2
Answers by
Missing User
Shake
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or