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

Problem with null when using RadDatePicker

2 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 10 Mar 2009, 08:52 AM
Sorry for double posting, I originally put this on the RadCalendar area, but not recieved any reply.

This is my aspx code for a RadDatePicker used in an Edit template on a RadGrid.

The problem is when I try to add new record the selected date doesn't exist and I get a cast error, I've tried an iif and isdbnull. but cant get it to work, can anyone help.

                                <div>

                                    <label class="gridlabel">Review Date:</label>

                                    <telerik:RadDatePicker  ID="txtReviewDate" runat="server" MinDate="2000-01-01" EnableEmbeddedSkins="False" Skin="Expert" EnableEmbeddedBaseStylesheet="False"  Width="100px" SelectedDate='<%# Eval("ReviewDate") %>' >

                                    <DateInput EnableEmbeddedSkins="False" LabelCssClass="radLabelCss_Expert" Skin="Expert" DateFormat="dd/MMM/yyyy"></DateInput>

                                    <Calendar EnableEmbeddedSkins="False" Skin="Expert" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x" FastNavigationNextImage="~/App_Themes/Expert/Calendar/fastNavRight.gif" FastNavigationPrevImage="~/App_Themes/Expert/Calendar/fastNavLeft.gif" NavigationNextImage="~/App_Themes/Expert/Calendar/arrowRight.gif" NavigationPrevImage="~/App_Themes/Expert/Calendar/arrowLeft.gif"></Calendar>

                                    <DatePopupButton CssClass="radPopupImage_Expert" HoverImageUrl="../App_Themes/Expert/Calendar/datePickerPopupHover.gif" ImageUrl="../App_Themes/Expert/Calendar/datePickerPopup.gif"/>

                                    </telerik:RadDatePicker>

                                </div>

Thanks

Andy

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 10 Mar 2009, 10:32 AM
Hello Andy,

Please try DbSelectedDate instead.

For more information I recommend you examine the following link:

Using RadInput Controls Inside Data-Bound Controls


Hope this helps.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Andy Green
Top achievements
Rank 2
answered on 10 Mar 2009, 10:41 AM
Spot on, thank you.
Andy
Tags
Grid
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Andy Green
Top achievements
Rank 2
Share this question
or