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

RadDatePicker Null value Issue

3 Answers 156 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 19 Jun 2014, 07:10 AM
Hi All,

I have webform with three bread crumbs for a registration process.

All the three bread crumbs are in a single webpage with different views in it. In first view these two RadDatePicker controls (one exam start date and other exam end date).

In edit mode these RadDatePicker.SelectedDate are becoming null so, I am facing an issue/Error "Nullable object must have a value"

Please help on it.

regards,
R

3 Answers, 1 is accepted

Sort by
0
Ramesh
Top achievements
Rank 1
answered on 19 Jun 2014, 08:53 AM
Please find the code below:

<telerik:RadDatePicker ID="startDate" runat="server" Width="90px" Calendar-ShowRowHeaders="false" AutoPostBack="true">
                                                <DateInput ReadOnly="true">
                                                </DateInput>
                                                <Calendar>
                                                    <SpecialDays>
                                                        <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" />
                                                    </SpecialDays>
                                                </Calendar>
                                            </telerik:RadDatePicker>
                                            <asp:RequiredFieldValidator ControlToValidate="startDate" Display="None" ErrorMessage="start Date Required"
                                                ValidationGroup="ED" SetFocusOnError="true" runat="server" ID="RequiredFieldValidator9"></asp:RequiredFieldValidator>

<telerik:RadDatePicker ID="EndDate" runat="server" Width="90px" Calendar-ShowRowHeaders="false" AutoPostBack="true">
                                                <DateInput ReadOnly="true">
                                                </DateInput>
                                                <Calendar>
                                                    <SpecialDays>
                                                        <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" />
                                                    </SpecialDays>
                                                </Calendar>
                                            </telerik:RadDatePicker>
                                            <asp:RequiredFieldValidator ControlToValidate="EndDate" Display="None"
                                                ValidationGroup="ED" ErrorMessage="End Date Required" SetFocusOnError="true"
                                                runat="server" ID="RequiredFieldValidator11"></asp:RequiredFieldValidator>

0
Eyup
Telerik team
answered on 24 Jun 2014, 07:14 AM
Hi Ramesh,

I have created a sample web site to test the described behavior using the provided code snippet. On my side the validation works as expected after configuring the ValidationGroup and Display properties of the validators. Please run the attached application and let me know about the result.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ramesh
Top achievements
Rank 1
answered on 03 Jul 2014, 07:10 AM
Thank you Eyup
Tags
Calendar
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Ramesh
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or