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

AdvanceEdit Template in Scheduler

1 Answer 55 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
AppliedHCS
Top achievements
Rank 1
AppliedHCS asked on 19 Apr 2012, 03:45 PM
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
"

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 24 Apr 2012, 08:42 AM
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.
Tags
Scheduler
Asked by
AppliedHCS
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or