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

RadDatePicker selected date problem when I try to add a new record

1 Answer 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Myriam
Top achievements
Rank 1
Myriam asked on 13 Nov 2008, 09:23 PM
hello
I have a RadGrid with MasterTableView and a DetailTableView. In my DetailTableView, when I edit my record, I have a RadDatePicker where I want to put the value of my field "DATE_DEBUT_EMPLOI" So I did it that way and that's working fine.

 

<telerik:GridTemplateColumn

 

 

UniqueName="TemplateColumnDateDebutEmploi"

 

 

HeaderText="Date de d‚but de l'emploi"

 

 

DataField="DATE_DEBUT_EMPLOI">

 

 

<ItemTemplate>

 

 

<asp:Label ID="LbDATE_DEBUT_EMPLOI" runat="server" Text='<%#Eval("DATE_DEBUT_EMPLOI") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadDatePicker ID="DPicker_DATE_DEBUT_EMPLOI" selecteddate='<%#Eval("DATE_DEBUT_EMPLOI") %>' Runat="server">

 

 

<Calendar ID="Calendar_DATE_DEBUT_EMPLOI" UseColumnHeadersAsSelectors="False" runat="server" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

 

 

</telerik:RadDatePicker>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

My problem is when I click on add new record for my detailTableView, I get the errror
"not a valid cast" (rapid traduction french to english by myself)
on the line 

 

<

telerik:RadDatePicker ID="DPicker_DATE_DEBUT_EMPLOI" selecteddate='<%#Eval("DATE_DEBUT_EMPLOI") %>' Runat="server">
What can I do to have the value of my field in that control when I edit but not having an erreur when I try to create a new record in my detailtableview

Thanks again in advance!

(I LOOOOVVVEEEE this forum!)

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 14 Nov 2008, 05:16 AM
Hi Myriam,

Try binding the DbSelectedDtae property instead of the SelectedDate property of the RadDatePicker. You can refer the following KB article to get more details.
Using RadDatePicker/RadDateTimePicker as editor in template column of RadGrid

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