This is a migrated thread and some comments may be shown as answers.
Multiple RadDateTimePickers
1 Answer 31 Views
This is a migrated thread and some comments may be shown as answers.
Sebastien Desemberg
Top achievements
Rank 1
Sebastien Desemberg asked on 04 Jan 2012, 11:17 AM
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>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 04 Jan 2012, 03:40 PM
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
Asked by
Sebastien Desemberg
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or