I'm using the Advanced Form inside of the scheduler with the ResourceControl code pasted from the Telerik demo.
When I set "Type" in the ascx page (my scheduler is in a user control), everything works fine. However, I need to set the Type programmatically from the C#.
It appears I should do this in the FormCreating event. The problem is that I do not know how to access the fields on the AdvancedForm at this point. I can use FindControl inside of FormCreated, but at that point it is too late to pass Type into the resource control.
Relevant .ascx code:
This works:
When I set "Type" in the ascx page (my scheduler is in a user control), everything works fine. However, I need to set the Type programmatically from the C#.
It appears I should do this in the FormCreating event. The problem is that I do not know how to access the fields on the AdvancedForm at this point. I can use FindControl inside of FormCreated, but at that point it is too late to pass Type into the resource control.
Relevant .ascx code:
This works:
<resource:ResourceControl runat="server" ID="ResVessel" Type="1132" /><AdvancedEditTemplate> <div class="rsAdvancedEdit rsAdvancedModal"> <div class="rsModalBgTopLeft"></div> <div class="rsModalBgTopRight"></div> <div class="rsModalBgBottomLeft"></div> <div class="rsModalBgBottomRight"></div> <div class="rsAdvTitle"> <h1 class="rsAdvInnerTitle">Production Order Details</h1> </div> <div class="rsAdvContentWrapper"> <div class="popUpDiv"> <h4>Required</h4> <br /> <div class="required-left"> <label>Material #</label> <telerik:RadTextBox runat="server" ID="txtMaterialNumber" CssClass="textbox" Text='<%# Bind("Subject") %>'></telerik:RadTextBox> <br /> <label>Batch #</label> <telerik:RadTextBox runat="server" ID="txtBatchNumber" CssClass="textbox" ></telerik:RadTextBox> <label>Vessel</label> <!-- Resource controls should follow the convention Res[Resource Name] for ID --> <resource:ResourceControl runat="server" ID="ResVessel" /> </div> <div class="required-right"> <label>Start Date</label> <telerik:RadDateTimePicker runat="server" ID="dtpStartDateTime" SelectedDate='<%# Bind("Start") %>' TimeView-RenderDirection="Vertical" ShowAnimation-Type="Slide" ShowPopupOnFocus="true" TimeView-Columns="4" TimeView-TimeFormat="H:00" Width="160px" DateInput-DisplayDateFormat="M/d/yyyy - H:00"> </telerik:RadDateTimePicker> <br /> <label>Complete Date</label> <telerik:RadDateTimePicker runat="server" ID="dtpEndDateTime" SelectedDate='<%# Bind("End") %>' TimeView-RenderDirection="Vertical" ShowAnimation-Type="Slide" ShowPopupOnFocus="true" TimeView-Columns="4" TimeView-TimeFormat="H:00" Width="160px" DateInput-DisplayDateFormat="M/d/yyyy - H:00"> </telerik:RadDateTimePicker> <br /> </div> </div> <div class="popUpDiv"> <h4>Optional</h4> <br /> <div class="optional-left"> <label>Ship Date</label> <telerik:RadDatePicker runat="server" ID="calShippingDate" Width="185px" ShowAnimation-Type="Slide" DateInput-DisplayDateFormat="M/d/yyyy" ShowPopupOnFocus="true"> </telerik:RadDatePicker> <br /> <label>Priority</label> <telerik:RadComboBox runat="server" ID="ddlPriority" CssClass="dropdownlist"> <Items> <telerik:RadComboBoxItem Text="Choose Priority" /> </Items> </telerik:RadComboBox> <br /> <label>Batch Size</label> <telerik:RadTextBox runat="server" ID="txtBatchSize" CssClass="textbox"></telerik:RadTextBox> <br /> <label>Wash Prep</label> <telerik:RadTextBox runat="server" ID="txtWashPrep" CssClass="textbox"></telerik:RadTextBox> <br /> <label id="raw-material-dep">Raw Material Dependency</label> <telerik:RadTextBox runat="server" ID="txtRawMaterialDependency" CssClass="textbox"></telerik:RadTextBox> </div> <div class="optional-right"> <label id="top-align">Comments</label> <telerik:RadTextBox runat="server" ID="txtComments" CssClass="textbox-multiline" Rows="7" TextMode="MultiLine" Width="200px"></telerik:RadTextBox> </div> </div> <asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea"> <div class="rsAdvButtonWrapper"> <asp:LinkButton CommandName="Update" runat="server" ID="btnUpdate" CssClass="rsAdvEditSave"> <span>Save</span> </asp:LinkButton> <asp:LinkButton runat="server" ID="btnCancel" CssClass="rsAdvEditCancel" CommandName="Cancel" CausesValidation="false"> <span>Cancel</span> </asp:LinkButton> </div> </asp:Panel> </div> </div> </AdvancedEditTemplate>