Hello I am a college student trying out the Telerik controls for the first time for a school project
I am currently trying to add a custom advancededit template to my scheduler and im having a hard time figuring out exactly which way would be best to handle my implementation
Here is a description of how I am trying to use the scheduler
I am building a web app for a dog grooming business
Appointments contain all the standard attributes of the regular scheduler including recurrence of appointments. I also need to add custom attributes for a client, dog, service, and groomer to the appointment.
I have columns in my appointments table for clientID, dogId, serviceId, and a guid for the groomer.
I have looked through the various examples that come packaged with the suite and I find they are either outdated or wont function exactly how I need them in my scenario
As a starting point I want to just add a drop down list in my form that contains my clients. I have added the AdvancedForm.ascx user control and put in a radcombobox which uses an objectdatasource to get the list of all my clients and so far that works.
My appointments table allows my clients to be NULL or an int which is a foreign key to my clients table
What I cant figure out is how to add logic to select the client that is assigned to a specific appointment when I open the form in edit mode for a currently existing appointment
EX: appointment is linked with client ID 15. when opening the appointment I want the drop down list to have the client selected that corresponds with value 15
here is a copy of my advanededit template tag. I'm not sure exactly what "ClientID" should refer to is it a database column ?
SelectedClient is the property I have exposed in AdvancedForm.ascx.cs I believe. What exactly does '<%# Bind("ClientID") %>' mean ?
<AdvancedEditTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"
Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
SelectedClient='<%# Bind("ClientID") %>' />
</AdvancedEditTemplate>
My exposed property in AdvancedForm.ascx.cs looks like this:
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public int SelectedClient
{
get
{
if (rcbClients.SelectedIndex == 0)
return 0;
return Convert.ToInt32(rcbClients.SelectedValue);
}
set
{
if (value.ToString().Length == 0)
rcbClients.SelectedIndex = 0;
else
rcbClients.SelectedValue = "15";
}
}
If I make my property return an int I get a server error "Specified cast is not valid."
I assumed how this would work is my combobox would return the selected clients value as an int which would be passed to my insertAppointment method in my AppointmentList.cs class and store it in the DB.
Is using the advancededit template form the best way to do this customization ?
I tried using the resourcesTypes collection feature on the smart tag of the scheduler but i found I couldn't find a way to add logic to select the client that applies to an appointment when loading the advanced form in edit mode for an existing appointment.
I also had issues when i would choose a client but no dog or a dog and no client for example it would give me a server error about my insertAppointment method not matching. if i selected nothing from the dropdown that property wouldn't be included in the attributes passed to my insert method
In other words i would have to write ovelroaded copies of insertAppointment for 2^n combination's of choices to handle nulls
If anyone can point me in a direction of a up to date example for Q1 2010 release i would be grateful.
The documented examples with roomid userid and colorpicker aren't detailed enough and the examples they are based off are very hard to integrate into my existing project
I am currently trying to add a custom advancededit template to my scheduler and im having a hard time figuring out exactly which way would be best to handle my implementation
Here is a description of how I am trying to use the scheduler
I am building a web app for a dog grooming business
Appointments contain all the standard attributes of the regular scheduler including recurrence of appointments. I also need to add custom attributes for a client, dog, service, and groomer to the appointment.
I have columns in my appointments table for clientID, dogId, serviceId, and a guid for the groomer.
I have looked through the various examples that come packaged with the suite and I find they are either outdated or wont function exactly how I need them in my scenario
As a starting point I want to just add a drop down list in my form that contains my clients. I have added the AdvancedForm.ascx user control and put in a radcombobox which uses an objectdatasource to get the list of all my clients and so far that works.
My appointments table allows my clients to be NULL or an int which is a foreign key to my clients table
What I cant figure out is how to add logic to select the client that is assigned to a specific appointment when I open the form in edit mode for a currently existing appointment
EX: appointment is linked with client ID 15. when opening the appointment I want the drop down list to have the client selected that corresponds with value 15
here is a copy of my advanededit template tag. I'm not sure exactly what "ClientID" should refer to is it a database column ?
SelectedClient is the property I have exposed in AdvancedForm.ascx.cs I believe. What exactly does '<%# Bind("ClientID") %>' mean ?
<AdvancedEditTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"
Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
SelectedClient='<%# Bind("ClientID") %>' />
</AdvancedEditTemplate>
My exposed property in AdvancedForm.ascx.cs looks like this:
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public int SelectedClient
{
get
{
if (rcbClients.SelectedIndex == 0)
return 0;
return Convert.ToInt32(rcbClients.SelectedValue);
}
set
{
if (value.ToString().Length == 0)
rcbClients.SelectedIndex = 0;
else
rcbClients.SelectedValue = "15";
}
}
If I make my property return an int I get a server error "Specified cast is not valid."
I assumed how this would work is my combobox would return the selected clients value as an int which would be passed to my insertAppointment method in my AppointmentList.cs class and store it in the DB.
Is using the advancededit template form the best way to do this customization ?
I tried using the resourcesTypes collection feature on the smart tag of the scheduler but i found I couldn't find a way to add logic to select the client that applies to an appointment when loading the advanced form in edit mode for an existing appointment.
I also had issues when i would choose a client but no dog or a dog and no client for example it would give me a server error about my insertAppointment method not matching. if i selected nothing from the dropdown that property wouldn't be included in the attributes passed to my insert method
In other words i would have to write ovelroaded copies of insertAppointment for 2^n combination's of choices to handle nulls
If anyone can point me in a direction of a up to date example for Q1 2010 release i would be grateful.
The documented examples with roomid userid and colorpicker aren't detailed enough and the examples they are based off are very hard to integrate into my existing project