Set SelectedDate RadDatePicker in Edit Form in RadGrid

2 posts, 0 answers
  1. Yefta
    Yefta avatar
    14 posts
    Member since:
    Mar 2015

    Posted 09 Sep 2015 Link to this post

    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

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2312 posts

    Posted 11 Sep 2015 Link to this post

    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
Back to Top