or
| Protected Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated | |
| HiddenFieldAppointmentID.Value = e.Container.Appointment.ID | |
| grdEvent.DataBind() | |
| If (e.Container.Mode = SchedulerFormMode.AdvancedEdit) OrElse (e.Container.Mode = SchedulerFormMode.AdvancedInsert) Then | |
| 'Find and hide the advanced control panel: | |
| 'Dim advancedPanel As Panel = DirectCast(e.Container.FindControl("AdvancedControlsPanel"), Panel) | |
| 'advancedPanel.Visible = false; | |
| RadScheduler1.Height = 350 | |
| ''Find the Recurrency checkbox and hide it. | |
| Dim recuranceCheckbox As CheckBox = DirectCast(e.Container.FindControl("RecurrentAppointment"), CheckBox) | |
| recuranceCheckbox.Visible = False | |
| ''Find the All Day checkbox and hide it. | |
| Dim AllDayEvent As CheckBox = DirectCast(e.Container.FindControl("AllDayEvent"), CheckBox) | |
| AllDayEvent.Visible = False | |
| 'Find the Subject textbox and set its Height: | |
| Dim subjectTextbox As TextBox = DirectCast(e.Container.FindControl("Subject"), TextBox) | |
| subjectTextbox.Height = Unit.Pixel(20) | |
| subjectTextbox.MaxLength = 50 | |
| subjectTextbox.CssClass = "NormalBlack" | |
| 'subjectTextbox.BackColor = System.Drawing.Color.LemonChiffon | |
| ''Find the DropDownList for the Room resource and set its SelectedIndex property. | |
| ''This is useful if you want to default to a specific resource selection. However, | |
| ''you should leave only the AdvancedInsert clause from the if statement above. | |
| Dim resEventTypeDDL As DropDownList = DirectCast(e.Container.FindControl("resType"), DropDownList) | |
| resEventTypeDDL.Width = 600 | |
| 'resEventTypeDDL.SelectedIndex = 1 | |
| 'Find the TextBox for the EventLocation custom attribute and set its properties: | |
| Dim attrEventLocationTextbox As TextBox = DirectCast(e.Container.FindControl("AttrEventLocation"), TextBox) | |
| 'attrEventLocationTextbox.BackColor = System.Drawing.Color.LemonChiffon | |
| attrEventLocationTextbox.MaxLength = 255 | |
| attrEventLocationTextbox.Width = 600 | |
| attrEventLocationTextbox.CssClass = "NormalBlack" | |
| Dim attrEventDescriptionTextbox As TextBox = DirectCast(e.Container.FindControl("AttrEventDescription"), TextBox) | |
| 'attrEventDescriptionTextbox.BackColor = System.Drawing.Color.LemonChiffon | |
| attrEventDescriptionTextbox.TextMode = TextBoxMode.MultiLine | |
| attrEventDescriptionTextbox.Rows = 4 | |
| attrEventDescriptionTextbox.Width = 600 | |
| attrEventDescriptionTextbox.CssClass = "NormalBlack" | |
| 'The description labels for Subject, Resources and Custom Attributes require a different | |
| 'approach since they are WebControls which dynamically add a label. | |
| 'Change the description for the EventLocation attribute: | |
| Dim attrWebcontrol1 As WebControl = DirectCast(e.Container.FindControl("LblAttrEventLocation"), WebControl) | |
| Dim attrLabel1 As New Label() | |
| attrLabel1.Text = "Location:" | |
| attrWebcontrol1.Controls.Clear() | |
| attrWebcontrol1.Controls.Add(attrLabel1) | |
| Dim attrWebcontrol2 As WebControl = DirectCast(e.Container.FindControl("LblAttrEventDescription"), WebControl) | |
| Dim attrLabel2 As New Label() | |
| attrLabel2.Text = "Description:" | |
| attrWebcontrol2.Controls.Clear() | |
| attrWebcontrol2.Controls.Add(attrLabel2) | |
| 'Change the description for the Subject. Please, note that since the description control | |
| 'for Subject does not render an ID, you need to use the first child of the Parent control | |
| 'of the subject TextBox. | |
| Dim subjectDescription As WebControl = DirectCast(subjectTextbox.Parent.Controls(0), WebControl) | |
| Dim subjectLabel1 As New Label() | |
| subjectLabel1.Text = "Event Summary:" | |
| subjectDescription.Controls.Clear() | |
| subjectDescription.Controls.Add(subjectLabel1) | |
| End If | |
| End Sub |
| <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="ddlStudy"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lstDataset" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManagerProxy> |
| Protected Sub RadContextMenu1_ItemClick(ByVal sender As Object, ByVal e As |
| Telerik.Web.UI.RadMenuEventArgs) |
| ' look only at child items |
| If e.Item.Level = 1 Then |
| ' find child items under "Colors" parent item |
| If (TryCast(e.Item.Parent, RadMenuItem)).Text.Equals("Colors") Then |
| ' set the color picker preset to the selected preset |
| RadColorPicker1.Preset = DirectCast([Enum].Parse(GetType(ColorPreset), e.Item.Text), |
| ColorPreset) |
| End If |
| End If |
| End Sub |
| End Class |
So my two questions would be:
1. Why is deleting the "Namespace" keyword eliminating the compilation error? I thought creating and using Namespaces is a way to
"package" classes. Thus, making them more unique.
2. Why is the RadContextMenu control working correctly in my application for the RadColorPicker control? (All I see when I right-click is the word "Color". No subitems as shown on page 43.
Thanks,
R2
|