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

Set SelectedDate RadDatePicker in Edit Form in RadGrid

1 Answer 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yefta
Top achievements
Rank 1
Yefta asked on 09 Sep 2015, 10:57 AM

Hi, i have a RadDatePicker in EditForm in RadGrid.

The column in RadGrid consist of EditButtonColumn, Name, StartDate, EndDate.

when i click Edit, it shows error:

Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.

I assume this is because the value StartDate and EndDate is empty/null.

my code to assign the value to RadDatePicker is like this:

<telerik:RadDatePicker ID="radStartDate" runat="server" Culture="en-US" TabIndex="8" Skin="MetroTouch" SelectedDate='<%# Bind("StartDate") %>'>
    <Calendar ID="Calendar1" runat="server">
        <SpecialDays>
            <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Yellow">
            </telerik:RadCalendarDay>
        </SpecialDays>
    </Calendar>
    <DateInput DisplayDateFormat="d/M/yyyy" DateFormat="d/M/yyyy" LabelWidth="40%" TabIndex="6">
    </DateInput>
</telerik:RadDatePicker>
 
<telerik:RadDatePicker ID="radEndDate" runat="server" Culture="en-US" TabIndex="9"  Skin="MetroTouch" SelectedDate='<%# Bind("EndDate") %>' >
    <Calendar ID="Calendar2" runat="server">
        <SpecialDays>
            <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Yellow">
            </telerik:RadCalendarDay>
        </SpecialDays>
    </Calendar>
    <DateInput DisplayDateFormat="d/M/yyyy" DateFormat="d/M/yyyy" LabelWidth="40%" TabIndex="6">
    </DateInput>
</telerik:RadDatePicker>

How to set RadDatePicker, when there's no value, shows no error. And if there's a value, the value of StartDate and EndDate will set to TextField and SelectedDate in RadDatePicker 

 

Thank you very much

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 11 Sep 2015, 01:30 PM
Hi Yefta,

I have replied to your query in the other thread you have submitted. I suggest we continue the conversation there.

On a side note, please avoid submitting duplicate threads. This will help us keep better track of your support history and provide answers faster.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Yefta
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or