Hello i am using example of "SchedulerCustomAdvancedFormQ1_2010_SP1" as reference to override AdvanceTemplate and trying to create the replicate form but with different ID's and Name. Here is detail of what i am trying to do. I am approximately half way through but dont know the source of error that is not letting this project functionality complete and i suspect there will be probably some sequence mistake.
Project Reference : SchedulerCustomAdvancedFormQ1_2010_SP1
Functionality: Instead of using Type and Resrouce as AdvanceTemplate Resources, i am trying to use Institute Name (InstituteName) and Institute Address (InstituteAddress) as resources in form of ComboBoxs.
Backend in SQLdatabase, i am using three tables.
1. Appointments
2. Institute_Name
3. Institute_Address
Institute_Name primary key is Inst_Sr_Id and Institute_Address primary key is Inst_Add_Sr and both are Foreign Keys in Appointments table.
Here is code that is used to bind their properties.
'Type, Resource
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property InstituteName() As String
Get
Return InstituteNameComboBox.SelectedItem.Value
End Get
Set(ByVal value As String)
InstituteNameComboBox.SelectedValue = value
End Set
End Property
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property InstituteAddress() As String
Get
Return InstituteAddressComboBox.SelectedItem.Value
End Get
Set(ByVal value As String)
InstituteAddressComboBox.SelectedValue = value
End Set
End Property![]()
![]()
Below is code that override InstituteName and InstituteAddress property and bind it to Control in AdvanceTemplate
<AdvancedEditTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1"
Mode="Edit" Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>'
InstituteName = '<%# Bind("InstituteName")%>'
InstituteAddress= '<%# Bind("InstituteAddress")%>'
/>
</AdvancedEditTemplate>
<AdvancedInsertTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1"
Mode="Insert" Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>'
InstituteName = '<%# Bind("InstituteName")%>'
InstituteAddress= '<%# Bind("InstituteAddress")%>'
/>
</AdvancedInsertTemplate>
The above code did help me to store Appointment Information but it was not helping to store Institute Name and Institute Address value into database untill i added the following code:
<telerik:ResourceType ForeignKeyField="Inst_Sr_Id"
KeyField="Inst_Sr_Id" Name="InstituteName" TextField="Inst_Name" />
<telerik:ResourceType ForeignKeyField="Inst_Add_Sr"
KeyField="Inst_Add_Sr" Name="InstituteAddress" TextField="Inst_Address" />
</ResourceTypes>
Now the Appointment Color, Institute Name and Address are getting store properly in Database BUT, once i try to edit any appointment, Institute_Name and Institute_Address does't pick their default value that is stored in database. Their behavoir is kind of normal which means on return value from database to Advance control, Values are not getting bind.
In AdvanceTemplate.ASCX, I am using two RadComboBox controll with Two SQLDatasource to populate data from database. Institute_Name popolate institute name data from Institute_Name table and on selection of any particular insitute, InstituteAddressComboBox change its data and pick all list of address that associate to particular Institute.
Can you please look into code and suggest for the following Issue
1. why Two way binding is not working for RadComboBox ( InstituteName and InstituteAddress)
2. In Appointment Template why the following Code is not working.
<AppointmentTemplate>
<div class="rsAptSubject">
<h3><%# Eval("Subject") %></h3>
</div>
<%# Eval("Description") %>
<P>
Institute : <i><%#Eval("InstituteName.Text")%></i>
</P>
<P>
Address : <i><%#Eval("InstituteAddress.Text")%></i>
</P>
</AppointmentTemplate>
I have Also changed the CustomAttributeNames to :
CustomAttributeNames="AppointmentColor,InstituteName,InstituteAddress"
May be i am asking too much ! or may be i have explained alot and problem could be minor. Please help so i may assemble it for demonstration to my supirors.
Regards
Adnan
Project Reference : SchedulerCustomAdvancedFormQ1_2010_SP1
Functionality: Instead of using Type and Resrouce as AdvanceTemplate Resources, i am trying to use Institute Name (InstituteName) and Institute Address (InstituteAddress) as resources in form of ComboBoxs.
Backend in SQLdatabase, i am using three tables.
1. Appointments
2. Institute_Name
3. Institute_Address
Institute_Name primary key is Inst_Sr_Id and Institute_Address primary key is Inst_Add_Sr and both are Foreign Keys in Appointments table.
Here is code that is used to bind their properties.
'Type, Resource
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property InstituteName() As String
Get
Return InstituteNameComboBox.SelectedItem.Value
End Get
Set(ByVal value As String)
InstituteNameComboBox.SelectedValue = value
End Set
End Property
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property InstituteAddress() As String
Get
Return InstituteAddressComboBox.SelectedItem.Value
End Get
Set(ByVal value As String)
InstituteAddressComboBox.SelectedValue = value
End Set
End Property
Below is code that override InstituteName and InstituteAddress property and bind it to Control in AdvanceTemplate
<AdvancedEditTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1"
Mode="Edit" Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>'
InstituteName = '<%# Bind("InstituteName")%>'
InstituteAddress= '<%# Bind("InstituteAddress")%>'
/>
</AdvancedEditTemplate>
<AdvancedInsertTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1"
Mode="Insert" Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>'
InstituteName = '<%# Bind("InstituteName")%>'
InstituteAddress= '<%# Bind("InstituteAddress")%>'
/>
</AdvancedInsertTemplate>
The above code did help me to store Appointment Information but it was not helping to store Institute Name and Institute Address value into database untill i added the following code:
<telerik:ResourceType ForeignKeyField="Inst_Sr_Id"
KeyField="Inst_Sr_Id" Name="InstituteName" TextField="Inst_Name" />
<telerik:ResourceType ForeignKeyField="Inst_Add_Sr"
KeyField="Inst_Add_Sr" Name="InstituteAddress" TextField="Inst_Address" />
</ResourceTypes>
Now the Appointment Color, Institute Name and Address are getting store properly in Database BUT, once i try to edit any appointment, Institute_Name and Institute_Address does't pick their default value that is stored in database. Their behavoir is kind of normal which means on return value from database to Advance control, Values are not getting bind.
In AdvanceTemplate.ASCX, I am using two RadComboBox controll with Two SQLDatasource to populate data from database. Institute_Name popolate institute name data from Institute_Name table and on selection of any particular insitute, InstituteAddressComboBox change its data and pick all list of address that associate to particular Institute.
Can you please look into code and suggest for the following Issue
1. why Two way binding is not working for RadComboBox ( InstituteName and InstituteAddress)
2. In Appointment Template why the following Code is not working.
<AppointmentTemplate>
<div class="rsAptSubject">
<h3><%# Eval("Subject") %></h3>
</div>
<%# Eval("Description") %>
<P>
Institute : <i><%#Eval("InstituteName.Text")%></i>
</P>
<P>
Address : <i><%#Eval("InstituteAddress.Text")%></i>
</P>
</AppointmentTemplate>
I have Also changed the CustomAttributeNames to :
CustomAttributeNames="AppointmentColor,InstituteName,InstituteAddress"
May be i am asking too much ! or may be i have explained alot and problem could be minor. Please help so i may assemble it for demonstration to my supirors.
Regards
Adnan