Hi,
I have a RadScheduler with a custom-templated inline insert form. I have one resource, called "Type". ASPX markup below:
I am using the AppointmentInsert event handler to perform a custom-insert method. I am having trouble, however, programatically accessing the value of the DropDownList "TypesList", which is bound to my resource "Type", in my inline insert form. Could you provide me with a code example of how this is done.
I have a RadScheduler with a custom-templated inline insert form. I have one resource, called "Type". ASPX markup below:
<telerik:RadScheduler ID="RadScheduler1" runat="server" AllowDelete="True" AllowEdit="True" AllowInsert="True" DataEndField="EndTime" DataKeyField="VacationID" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject" DayStartTime="09:00:00" HoursPanelTimeFormat="h:mm tt" SelectedDate="2007-11-12" SelectedView="MonthView" WorkDayEndTime="18:00:00" WorkDayStartTime="09:00:00" Height="600px" OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnAppointmentInsert="RadScheduler1_AppointmentInsert"> |
<ResourceTypes> |
<telerik:ResourceType KeyField="VacationTypeID" Name="Type" TextField="VacationType" ForeignKeyField="AppointmentTypeID" DataSourceID="SqlDataSource3" /> |
</ResourceTypes> |
<InlineInsertTemplate> |
<asp:TextBox |
ID="TitleTextBox" |
runat="server" |
Text='<%# Bind("Subject") %>' |
Width="90%" |
TextMode="MultiLine" |
Height="20px"> |
</asp:TextBox> |
<asp:DropDownList |
runat="server" |
ID="TypesList" |
DataValueField="VacationTypeID" |
DataSourceID="SqlDataSource3" |
SelectedValue = '<%# Bind("Type") %>' |
DataTextField="VacationType" |
> |
</asp:DropDownList> |
<asp:LinkButton |
ID="InsertButton" |
runat="server" |
CommandName="Insert"> |
Insert |
</asp:LinkButton> |
<asp:LinkButton |
ID="InsertCancelButton" |
runat="server" |
CausesValidation="False" |
CommandName="Cancel"> |
Cancel |
</asp:LinkButton> |
</InlineInsertTemplate> |
<AppointmentTemplate> |
<%# Eval("Subject") %> (<%# Eval("Type.Text") %>) |
</AppointmentTemplate> |
</telerik:RadScheduler> |
<br /> |
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:razzaConnectionString %>" |
DeleteCommand="DELETE FROM Vacations WHERE (VacationID = @VacationID)" InsertCommand="INSERT INTO Vacations(Subject, Start, EndTime, UserID, RoomID, RecurrenceRule, RecurrenceParentID, AppointmentTypeID) VALUES (@Subject, @Start, @EndTime, @UserID, 1, @RecurrenceRule, @RecurrenceParentID, @AppointmentTypeID)" |
SelectCommand="SELECT Vacations.*, VacationTypes.VacationType as TypeName FROM Vacations INNER JOIN VacationTypes ON VacationTypes.VacationTypeID=Vacations.AppointmentTypeID" |
UpdateCommand="UPDATE Vacations SET Subject = @Subject, Start = @Start, EndTime = @EndTime, RoomID = 1, RecurrenceRule = @RecurrenceRule, RecurrenceParentID = @RecurrenceParentID, AppointmentTypeID=@AppointmentTypeID WHERE VacationID=@VacationID"> |
<DeleteParameters> |
<asp:Parameter Name="VacationID" /> |
<asp:Parameter Name="Subject" /> |
<asp:Parameter Name="Start" /> |
<asp:Parameter Name="EndTime" /> |
<asp:Parameter Name="UserID" /> |
<asp:Parameter Name="RecurrenceRule" /> |
<asp:Parameter Name="RecurrenceParentID" /> |
<asp:Parameter Name="AppointmentTypeID" /> |
</DeleteParameters> |
<UpdateParameters> |
<asp:Parameter Name="Subject" /> |
<asp:Parameter Name="Start" /> |
<asp:Parameter Name="EndTime" /> |
<asp:Parameter Name="UserID" /> |
<asp:Parameter Name="RecurrenceRule" /> |
<asp:Parameter Name="RecurrenceParentID" /> |
<asp:Parameter Name="VacationID" /> |
<asp:Parameter Name="AppointmentTypeID" /> |
</UpdateParameters> |
</asp:SqlDataSource> |
</div> |
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:razzaConnectionString %>" |
SelectCommand="SELECT [EmployeeID], [EmployeeName] FROM [Prezza_Employees]"></asp:SqlDataSource> |
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:razzaConnectionString %>" |
SelectCommand="SELECT [VacationTypeID], [VacationType] FROM [VacationTypes]"></asp:SqlDataSource> |
</form> |
I am using the AppointmentInsert event handler to perform a custom-insert method. I am having trouble, however, programatically accessing the value of the DropDownList "TypesList", which is bound to my resource "Type", in my inline insert form. Could you provide me with a code example of how this is done.