Problem with null when using RadDatePicker

3 posts, 1 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 10 Mar 2009 Link to this post

    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. Answer
    Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 10 Mar 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 10 Mar 2009 Link to this post

    Spot on, thank you.
    Andy
Back to Top