AdvanceEdit Template in Scheduler

2 posts, 0 answers
  1. AppliedHCS
    AppliedHCS avatar
    9 posts
    Member since:
    Dec 2011

    Posted 19 Apr 2012 Link to this post

    Hi,
    I have used the Advance edit template for my scheduler,I which I'm trying to Bind the Date value but some how Its not binding and giving me the the error "Specified cast is Invalid".The Dateformat is "MM/dd/yyyy" ,used the raddatepicker.
    advanceusercontrol.ascx.cs
     [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
           
    public DateTime Start
            {          
    get          {                    return  Convert.ToDateTime(dpDtofVisit.DbSelectedDate.ToString());                      }            set          {               dpDtofVisit.DbSelectedDate = value;                      }      }

    webform1.aspx 
    <AdvancedEditTemplate><br><span class="Apple-tab-span" style="white-space:pre">               </span>    <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"  Subject='<%# Bind("Reason") %>'<br><span class="Apple-tab-span" style="white-space:pre">                  </span>    Name='<%# Bind("Name") %>'   Office='<%# Bind("Office") %>' Status='<%# Bind("Status") %>' Start='<%# Bind("DATE") %>'  <br>                      <span class="Apple-tab-span" style="white-space:pre">   </span> PatientName='<%# Bind("PatNum") %>'  /><span class="Apple-tab-span" style="white-space:pre">      </span>                       <span class="Apple-tab-span" style="white-space:pre">      </span>   <br><span class="Apple-tab-span" style="white-space:pre">           </span>    </AdvancedEditTemplate>

    I have placed the sample code which i tried .
    "Start='<%# Bind("DATE") %>'   " this section gives me the error

    Regards
    "
  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 24 Apr 2012 Link to this post

    Hi Parag,

    "Start='<%# Bind("DATE") %>'
    There should be a property in the Appointment named DATE. In your case the name of the property, which gets/sets the start time of an appointment, is named Start, therefore the start time in the edit appointment form should be bound like the following:
    "Start='<%# Bind("Start") %>'

    For more information you could take a look at the code of the following online demo:
    http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx.

    Greetings,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top