Multiple RadDateTimePickers

2 posts, 0 answers
  1. Sebastien Desemberg
    Sebastien Desemberg avatar
    15 posts
    Member since:
    Nov 2009

    Posted 04 Jan 2012 Link to this post

    I have two RadDateTimePickers embedded in a DetailsView. The problem is that when I run the page, the picker for RadDatePickerStarts  inputs the date&time in the text box for the second picker (RadDatePickerEnds). The second picker  does not input the selected date&time anywhere. How do I get each picker to place input into the correct box?
     
      <asp:TemplateField HeaderText="Starts" SortExpression="Starts">
                        <EditItemTemplate>
                            <telerik:RadDateTimePicker ClientIDMode="Static" SelectedDate='<%# Bind("Starts") %>'
                                ID="RadDatePickerStarts" runat="server">
                            </telerik:RadDateTimePicker>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <telerik:RadDateTimePicker ClientIDMode="Static" SelectedDate='<%# Bind("Starts") %>'
                                ID="RadDatePickerStarts" runat="server">
                            </telerik:RadDateTimePicker>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <telerik:RadDateTimePicker ClientIDMode="Static" SelectedDate='<%# Bind("Starts") %>'
                                ID="RadDatePickerStarts" runat="server">
                            </telerik:RadDateTimePicker>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ends" SortExpression="Ends">
                        <EditItemTemplate>
                            <telerik:RadDateTimePicker ClientIDMode="Static" SelectedDate='<%# Bind("Ends") %>'
                                ID="RadDatePickerEnds" runat="server">
                            </telerik:RadDateTimePicker>
                            <asp:CompareValidator ID="CompareValidator1" runat="Server" ControlToCompare="RadDatePickerStarts"
                                ControlToValidate="RadDatePickerEnds" Operator="GreaterThan" ErrorMessage="Date range is not valid "
                                Display="Dynamic" />
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <telerik:RadDateTimePicker ClientIDMode="Static" SelectedDate='<%# Bind("Ends") %>'
                                ID="RadDatePickerEnds" runat="server">
                            </telerik:RadDateTimePicker>
                            <asp:CompareValidator ID="CompareValidator1" runat="Server" ControlToCompare="RadDatePickerStarts"
                                ControlToValidate="RadDatePickerEnds" Operator="GreaterThan" ErrorMessage="Date range is not valid "
                                Display="Dynamic" />
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <telerik:RadDateTimePicker ClientIDMode="Static" SelectedDate='<%# Bind("Ends") %>'
                                ID="RadDatePickerEnds" runat="server">
                            </telerik:RadDateTimePicker>
                        </ItemTemplate>
                    </asp:TemplateField>
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 04 Jan 2012 Link to this post

    Hello,

    Please note that using Static ID mode for Rad controls is not supported. You should use AutoID mode for the RadDatePicker controls on the page.
    Microsoft recommends using ClientIDMode=Static only for static control. RadControls on the other hand are controls with complex hierarchies of child controls and templates so setting their ClientID mode to static will break their functionality.


    Regards,
    Maria Ilieva
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top