or
foreach (var gi in rgVendorInvItems.MasterTableView.GetItems(GridItemType.GroupHeader)){ gi.SetChildrenVisible(false);}<telerik:RadMenu runat="server" ID="RadMenu1" Skin="Vista" DataFieldID="ItemId" DataFieldParentID="ParentItemId" DataValueField="ItemId" DataTextField="Text" OnClientLoad="OnClientMenuLoaded"> <DefaultGroupSettings RepeatColumns="3" RepeatDirection="Vertical" /> </telerik:RadMenu>namespace WebApplication1{ public partial class ListViewIn_Menu : System.Web.UI.Page { protected override void OnInit(EventArgs e) { RadMenu1.ItemTemplate = new TextBoxTemplate(); base.OnInit(e); } protected void Page_Load(object sender, EventArgs e) { //Construct source list to bind to Menu List<MenuSelection> lstV = new List<MenuSelection>(); MenuSelection lstItm; for(int i = 1; i<= 50 ; i++) { if (lstV.Count == 0) { lstItm = new MenuSelection(); lstItm.ParentItemId = 0; lstItm.ItemId = lstV.Count + 1; lstItm.Checked = false; lstItm.Text = "MenuLevel1"; } else { lstItm = new MenuSelection(); lstItm.ItemId = lstV.Count + 1; lstItm.ParentItemId = 1; lstItm.Checked = GetSelectedList().Contains(lstItm.ItemId); lstItm.Text = "MenuLevel2_" + (lstV.Count + 1).ToString(); } lstV.Add(lstItm); } RadMenu1.DataSource = lstV; RadMenu1.DataBind(); } private List<int> GetSelectedList() { //Get the selected checkbox text from hidden field (where checkbox is checked) List<int> selList = new List<int>(); foreach (string itm in hidSelectedList.Value.Split(new char[] { '|' })) { if (!string.IsNullOrEmpty(itm)) { selList.Add(Convert.ToInt32(itm)); } } return selList; } } public class MenuSelection { public MenuSelection() { } public int ItemId { get; set; } public int ParentItemId { get; set; } public string Text { get; set; } public bool Checked { get; set; } } class TextBoxTemplate : ITemplate { public void InstantiateIn(Control container) { CheckBox cb = new CheckBox(); cb.DataBinding += new EventHandler(cb_DataBinding); container.Controls.Add(cb); } void cb_DataBinding(object sender, EventArgs e) { CheckBox target = (CheckBox)sender; RadMenuItem item = (RadMenuItem)target.BindingContainer; MenuSelection ds = (MenuSelection)item.DataItem; target.Checked = ds.Checked; target.Text = ds.Text; target.ID = "ck"; target.Attributes.Add("onclick", "OnMenuCheck_Click('" + ds.ItemId.ToString() + "')"); } }I have a requirement in which I need to hide the recurrence check box form the Edit Appointment dialog. I wonder if this is possible
Thank you
J
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Panel ID="pnlDefaultButtonSupport" runat="server" DefaultButton="btnOk"><fieldset class="noborder" style="width: 780px;"> <telerik:RadSchedulerRecurrenceEditor runat="server" ID="rscr"> </telerik:RadSchedulerRecurrenceEditor> </fieldset><div class="ActionContainerNoBottom" style="width: 780px"> <asp:Button ID="btnOk" runat="server" Text="Save" SkinID="CommandButton"/> <asp:Button ID="btnClose" runat="server" Text="Close" PostBackUrl="javascript:GetRadWindow().close();" SkinID="CommandButton" CausesValidation="false"/></div></asp:Panel><telerik:RadWindowManager ID="rwmRecord" runat="server" Height="500" Width="900" ShowOnTopWhenMaximized="false" Behaviors="Close,Move,Resize,Maximize,Reload,Minimize" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false" EnableShadow="true" OnClientClose="OnClientClose" OnClientCommand="OnClientCommand">protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) { // checking if the current time slot is blocked if (TimeSlotBlocked(e.TimeSlot.Resource.Key.ToString(), e.TimeSlot.Start, e.TimeSlot.End)) { e.TimeSlot.CssClass = "Disabled"; } }protected bool TimeSlotBlocked(String pt, DateTime dt1, DateTime dt2) { foreach (PTBlockedTime bt in blockedTime) { if ((pt == bt.PersonalTrainerId) && ((dt1.AddMinutes(+1) >= bt.Start && dt1.AddMinutes(+1) <= bt.End) || (dt2.AddMinutes(-1) >= bt.Start && dt2.AddMinutes(-1) <= bt.End))) { return true; } } return false; }public struct PTBlockedTime { public String PersonalTrainerId; public DateTime Start; public DateTime End; public PTBlockedTime(String pt, DateTime dt1, DateTime dt2) { PersonalTrainerId = pt; Start = dt1; End = dt2; } } . . . List<PTBlockedTime> blockedTime = new List<PTBlockedTime>();DateTime aux1 = new DateTime(2012, 1, 25, 8, 0, 0); DateTime aux2 = new DateTime(2012, 1, 25, 10, 0, 0); PTBlockedTime aux = new PTBlockedTime("575204", aux1, aux2); blockedTime.Add(aux);
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { //add the new appointment to the db int? recurrentParentId = null; if (e.Appointment.RecurrenceParentID != null) recurrentParentId = (int)e.Appointment.RecurrenceParentID; AppointmentManager.AddUserAppointment( UserId, 1, e.Appointment.Start, e.Appointment.End, e.Appointment.RecurrenceRule, recurrentParentId, e.Appointment.Description, e.Appointment.Subject); BindSchedule(); }mySchedule.DataSource = GetSchedule(); //calls the database and gets the appointmentsmySchedule.DataBind();<telerik:RadScheduler runat="server" ID="mySchedule" DayStartTime="08:00:00" DayEndTime="22:00:00" StartInsertingInAdvancedForm="true" ShowNavigationPane="true" OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentDelete="RadScheduler1_AppointmentDelete" DataKeyField="AppointmentId" DataSubjectField="Subject" DataDescriptionField="Description" DataStartField="Start" DataEndField="EndX" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId" FirstDayOfWeek="Monday" ShowHeader="true" ShowFooter="false"> <AdvancedForm Modal="true" /> <DayView UserSelectable="false" /> <WeekView UserSelectable="false" /> <MonthView UserSelectable="false" /> <TimeSlotContextMenuSettings EnableDefault="true" /> <AppointmentContextMenuSettings EnableDefault="true" /> <ResourceTypes> <telerik:ResourceType KeyField="ID" Name="Type" TextField="Keyword" ForeignKeyField="AppointmentTypeID" DataSourceID="AppointmentTypesDataSource" /> </ResourceTypes> <ResourceStyles> <telerik:ResourceStyleMapping Type="Type" Text="Event" ApplyCssClass="rsCategoryGreen" /> <telerik:ResourceStyleMapping Type="Type" Text="Personal" ApplyCssClass="rsCategoryBlue" /> <telerik:ResourceStyleMapping Type="Type" Text="Meeting" ApplyCssClass="rsCategoryYellow" /> </ResourceStyles> <AppointmentTemplate> <!--narrowed down template--> <div > <h2> <%# Eval("Subject") %> </h2> <div> </div> </div> </AppointmentTemplate></telerik:RadScheduler>