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

Specified cast is not valid

3 Answers 232 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shed Dweller
Top achievements
Rank 1
Shed Dweller asked on 30 Jul 2008, 07:42 PM
I have a simple grid bound to an object data source.

I have configured the grid to use a form template for inline editing.

When I click the grid's "Add new record" button I get an exception....

Specified cast is not valid

I have traced this to the use of  RadDatePickers in the form.  If I use ordinary text fields for the dates then the problem doesn't occur.

This is the snippet of code that is in the <FormTemplate>

<

telerik:RadDatePicker ID="RadDue" runat="server" SelectedDate='<%# Bind("DueDate") %>' EnableTyping="false">

</telerik:RadDatePicker>



3 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir
Top achievements
Rank 1
answered on 30 Jul 2008, 08:01 PM
Hi Sean,

Please use DbSelectedDate instead.

Vlad
0
Shed Dweller
Top achievements
Rank 1
answered on 31 Jul 2008, 07:11 AM
Many thanks Vlad!  That worked perfectly.
0
Shinu
Top achievements
Rank 2
answered on 31 Jul 2008, 07:58 AM
Hi Sean,

You can also refer the following KB article which explains about RadDatePicker as the editor in GridTemplateColumn.
Using RadDatePicker/RadDateTimePicker as editor in template column of RadGrid

Thanks
Shinu.
Tags
Grid
Asked by
Shed Dweller
Top achievements
Rank 1
Answers by
Vladimir
Top achievements
Rank 1
Shed Dweller
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or