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

New record in Grid as DateTime

4 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krzysztof
Top achievements
Rank 1
Krzysztof asked on 15 Dec 2008, 01:50 PM
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

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Dec 2008, 02:01 PM
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.
0
Krzysztof
Top achievements
Rank 1
answered on 15 Dec 2008, 02:12 PM
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
0
Josh
Top achievements
Rank 1
answered on 18 Feb 2009, 04:31 PM
DbSelectedDate does work.  Are you going to add this property into the Intellisense library of the control?
0
Vlad
Telerik team
answered on 19 Feb 2009, 07:03 AM
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.
Tags
Grid
Asked by
Krzysztof
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Krzysztof
Top achievements
Rank 1
Josh
Top achievements
Rank 1
Share this question
or