New record in Grid as DateTime

5 posts, 0 answers
  1. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 15 Dec 2008 Link to this post

    Hi

    In RadGrid I have :

    .......  
    <FormTemplate> 
    <telerik:RadDatePicker runat="server" ID="PickerTimeFrom"   
       SelectedDate='<%# DataBinder.Eval( Container, "DataItem.timeFrom" ) %>'   >                                          
    </telerik:RadDatePicker> 
     
    .... 

    When I get data to edit in this Grid everything work well.
    But if I click "new record" link on footer of RadGrid I get : Specified cast is not valid.

    How can I fix it ??

    Regards
    Krzysztof
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Dec 2008 Link to this post

    Hello Krzysztof,

    Please use DbSelectedDate instead!

    All the best,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 15 Dec 2008 Link to this post

    Hi Vlad

    I can't find DbSelectedDate but I made :

    <telerik:RadDatePicker runat="server" ID="PickerTimeFrom"                        
        SelectedDate='<%# (Eval("timeFrom") is DBNull ?null:Eval("timeFrom")) %>'     
        >         
    <ClientEvents OnDateSelected="OnDateSelectedFrom" />                                    
    </telerik:RadDatePicker> 

     .. and it work well.

    Regards
    Krzysztof
  5. Josh
    Josh avatar
    21 posts
    Member since:
    Mar 2007

    Posted 18 Feb 2009 Link to this post

    DbSelectedDate does work.  Are you going to add this property into the Intellisense library of the control?
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 19 Feb 2009 Link to this post

    Hi Josh,

    Since DbSelectedDate is of type Object the Visual Studio cannot create Intellisense for this property.

    Best wishes,
    Vlad
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017