or
<telerik:RadButton ID="rbTest" runat="server" ButtonType="ToggleButton" Style="padding-left: 25px" ToggleType="CheckBox" AutoPostBack="false" Checked='<%# Test(Eval("Test")) %>'> <ToggleStates> <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" /> <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" /> </ToggleStates> </telerik:RadButton>rbTest.Attributes.Add(
"OnClientCheckedChanged", "return show('0','0')");
It just doesn't seem to be firing.
Any ideas?
Thanks
<ItemTemplate> <fieldset style="float: left; width: 270px; height: 110px;"> <div> <asp:ImageButton ID="imgCategory" runat="server" OnClick="imgCategory_Click" OnDataBinding="imgCategory_DataBind"CommandArgument='<%# Eval("CategoryId") %>'/> </div> </fieldset></ItemTemplate><telerik:RadScheduler ID="RadScheduler1" runat="server" TimelineView-NumberOfSlots="5" Width="900px" Skin="Web20" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="false" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" DataKeyField="ID" DataReminderField="Reminder" EnableDescriptionField="true" EnableReminderField="true" GroupingDirection="Vertical" StartInsertingInAdvancedForm="True" AdvancedForm-Modal="False" OnAppointmentDelete="RadScheduler1_AppointmentDelete" OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnFormCreating="RadScheduler1_FormCreating" OnFormCreated="RadScheduler1_FormCreated" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnDataBound="RadScheduler1_OnDataBound" OnNavigationComplete="RadScheduler1_NavigationComplete" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"> <WeekView DayStartTime="06:00:00" DayEndTime="23:59:00" WorkDayStartTime="08:00:00" WorkDayEndTime="18:00:00" /> <DayView DayStartTime="06:00:00" DayEndTime="23:59:00" WorkDayStartTime="08:00:00" WorkDayEndTime="18:00:00" /> <MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" /> <TimelineView SlotDuration="12:00:00" NumberOfSlots="10" TimeLabelSpan="2" ColumnHeaderDateFormat="dddd, MMMM d" /> <Reminders Enabled="true" /> <ResourceStyles> <telerik:ResourceStyleMapping Type="Category" Text="Out of Office" ApplyCssClass="rsCategoryViolet" /> <telerik:ResourceStyleMapping Type="Category" Text="After Hours" ApplyCssClass="rsCategoryRed" /> <telerik:ResourceStyleMapping Type="Category" Text="Projects" ApplyCssClass="rsCategoryDarkGreen" /> <telerik:ResourceStyleMapping Type="Category" Text="MACs" ApplyCssClass="rsCategoryGreen" /> <telerik:ResourceStyleMapping Type="Category" Text="VNMS" ApplyCssClass="rsCategoryDarkBlue" /> <telerik:ResourceStyleMapping Type="Category" Text="IPT/Engineering" ApplyCssClass="rsCategoryDarkRed" /> <telerik:ResourceStyleMapping Type="Category" Text="Other" ApplyCssClass="rsCategoryOrange" /> <telerik:ResourceStyleMapping Type="Category" Text="Remote Day" ApplyCssClass="rsCategoryYellow" /> <telerik:ResourceStyleMapping Type="Category" Text="Region Coverage" ApplyCssClass="rsCategoryPink" /> </ResourceStyles> <TimeSlotContextMenuSettings EnableDefault="true" /> <AppointmentContextMenuSettings EnableDefault="true" /> </telerik:RadScheduler>protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { int userCount = 0; foreach (Resource user in e.Appointment.Resources.GetResourcesByType("User Name")) { userCount++; } string categoryName = ""; if (e.Appointment.Resources.GetResourceByType("Category") != null) { categoryName = e.Appointment.Resources.GetResourceByType("Category").Text; } e.Cancel = userCount == 0 || categoryName == ""; if (e.Cancel) { ScriptManager.RegisterClientScriptBlock(lblJscript, this.GetType(), "alert", "alert('Please select a user and category to continue');", true); pnlJScript.Update(); e.Cancel = true; } else { if (userCount == 1) { using (ProNetData d = new ProNetData()) { Resource user = e.Appointment.Resources.GetResourceByType("User Name"); Resource client = e.Appointment.Resources.GetResourceByType("Client Name"); Resource category = e.Appointment.Resources.GetResourceByType("Category"); string RecurrenceRule = e.Appointment.RecurrenceRule; int userID = SafeValue.SafeInt0(user.Key.ToString()); TED.BLL.Appointment a = new TED.BLL.Appointment(); AppointmentUsers u = d.AppointmentUsers.Where(i => i.UserID == userID).FirstOrDefault(); a.Subject = e.Appointment.Subject; a.Description = e.Appointment.Description != string.Empty ? e.Appointment.Description : null; a.Start = e.Appointment.Start.ToUniversalTime(); a.End = e.Appointment.End.ToUniversalTime(); a.CreationTime = DateTime.Now; a.LastModificationTime = DateTime.Now; if (user != null) { a.UserID = SafeValue.SafeInt0(user.Key.ToString()); } if (client != null) { a.ClientID = SafeValue.SafeInt0(client.Key.ToString()); } if (category != null) { a.CategoryID = SafeValue.SafeInt0(category.Key.ToString()); } a.Mailbox = u.Email; a.OutlookCreated = false; if (RecurrenceRule != "") { //int index = RecurrenceRule.LastIndexOf(":"); int index = RecurrenceRule.LastIndexOf("FREQ") - 1; string s = RecurrenceRule.Substring(index + 1).Replace("\r\n","") +";WKST=SU"; a.RecurrenceRule = s; if (RecurrenceRule.Contains("DAILY")) { a.RecurrenceType = 0; } else if (RecurrenceRule.Contains("WEEKLY")) { a.RecurrenceType = 1; } else if (RecurrenceRule.Contains("MONTHLY")) { a.RecurrenceType = 2; } else if (RecurrenceRule.Contains("YEARLY")) { a.RecurrenceType = 6; } a.IsRecurring = true; } else { a.IsRecurring = false; a.RecurrenceType = null; } if (e.Appointment.RecurrenceParentID != null) { a.RecurrenceParentID = int.Parse(e.Appointment.RecurrenceParentID.ToString()); } a.SyncToExchange = true; d.AddToAppointments(a); d.SaveChanges(); if (a.ID > 0) { try { string desc = ""; string clientName = ""; if (a.Description != null) { desc = a.Description; } if (client != null) { clientName = client.Text; } //if (pm != null) { pmID = int.Parse(pm.Key.ToString()); } SendMail(a.UserID, "<b>Subject:</b> " + a.Subject + "<br><b>Start:</b> " + a.Start + "<br><b>End:</b> " + a.End + "<br><b>Description:</b> " + desc + "<br><b>Client:</b> " + clientName, (int)InsertUpdateDelete.Insert); } catch { } } } } else { foreach (Resource user in e.Appointment.Resources.GetResourcesByType("User Name")) { using (ProNetData d = new ProNetData()) { //Resource pm = e.Appointment.Resources.GetResourceByType("Email PM"); Resource client = e.Appointment.Resources.GetResourceByType("Client Name"); Resource category = e.Appointment.Resources.GetResourceByType("Category"); string RecurrenceRule = e.Appointment.RecurrenceRule; int userID = SafeValue.SafeInt0(user.Key.ToString()); TED.BLL.Appointment a = new TED.BLL.Appointment(); AppointmentUsers u = d.AppointmentUsers.Where(i => i.UserID == userID).FirstOrDefault(); a.Subject = e.Appointment.Subject; a.Description = e.Appointment.Description != string.Empty ? e.Appointment.Description : null; a.Start = e.Appointment.Start.ToUniversalTime(); a.End = e.Appointment.End.ToUniversalTime(); a.CreationTime = DateTime.Now; a.LastModificationTime = DateTime.Now; if (user != null) { a.UserID = SafeValue.SafeInt0(user.Key.ToString()); } if (client != null) { a.ClientID = SafeValue.SafeInt0(client.Key.ToString()); } if (category != null) { a.CategoryID = SafeValue.SafeInt0(category.Key.ToString()); } a.Mailbox = u.Email; a.OutlookCreated = false; if (RecurrenceRule != "") { //int index = RecurrenceRule.LastIndexOf(":"); int index = RecurrenceRule.LastIndexOf("FREQ") - 1; string s = RecurrenceRule.Substring(index + 1).Replace("\r\n", "") + ";WKST=SU"; a.RecurrenceRule = s; if (RecurrenceRule.Contains("DAILY")) { a.RecurrenceType = 0; } else if (RecurrenceRule.Contains("WEEKLY")) { a.RecurrenceType = 1; } else if (RecurrenceRule.Contains("MONTHLY")) { a.RecurrenceType = 2; } else if (RecurrenceRule.Contains("YEARLY")) { a.RecurrenceType = 6; } a.IsRecurring = true; } else { a.IsRecurring = false; a.RecurrenceType = null; } if (e.Appointment.RecurrenceParentID != null) { a.RecurrenceParentID = int.Parse(e.Appointment.RecurrenceParentID.ToString()); } a.SyncToExchange = true; d.AddToAppointments(a); d.SaveChanges(); if (a.ID > 0) { try { string desc = ""; string clientName = ""; if (a.Description != null) { desc = a.Description; } if (client != null) { clientName = client.Text; } SendMail(a.UserID, "<b>Subject:</b> " + a.Subject + "<br><b>Start:</b> " + a.Start + "<br><b>End:</b> " + a.End + "<br><b>Description:</b> " + desc + "<br><b>Client:</b> " + clientName, (int)InsertUpdateDelete.Insert); } catch { } } } } } } BindSchedule(); }| <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" EnableEmbeddedSkins="false" Skin="Main" AllowFilteringByColumn="true"> |
| <MasterTableView DataKeyNames="ContractID"> |
| <Columns> |
| <telerik:GridButtonColumn ItemStyle-CssClass="editcolumn" CommandName="Edit" Text="Details/Edit" UniqueName="EditColumn" /> |
| <telerik:GridBoundColumn UniqueName="ContractID" FilterControlWidth="40px" HeaderText="Reference" DataField="ContractID" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| <telerik:GridBoundColumn UniqueName="Address" FilterControlWidth="120px" HeaderText="Address" DataField="Address" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| <telerik:GridDateTimeColumn DataType="System.DateTime" UniqueName="StartDate" FilterControlWidth="100px" HeaderText="Starts" DataField="StartDate" DataFormatString="{0:d}" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| <telerik:GridDateTimeColumn DataType="System.DateTime" UniqueName="EndDate" FilterControlWidth="100px" HeaderText="Ends" DataField="EndDate" DataFormatString="{0:d}" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| <telerik:GridNumericColumn UniqueName="Rent" FilterControlWidth="40px" HeaderText="Rent" DataField="Rent" DataFormatString="{0:C}" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| <telerik:GridBoundColumn UniqueName="Frequency" FilterControlWidth="60px" HeaderText="Rent Frequency" DataField="Frequency" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| <telerik:GridBoundColumn UniqueName="Status" FilterControlWidth="60px" HeaderText="Status" DataField="Status" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" /> |
| </Columns> |
| <SortExpressions> |
| <telerik:GridSortExpression FieldName="ContractID" SortOrder="Descending" /> |
| </SortExpressions> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="true" Resizing-AllowColumnResize="true" /> |
| </telerik:RadGrid> |
| Private Sub RadGrid1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.Init |
| Dim menu As GridFilterMenu = RadGrid1.FilterMenu |
| Dim i As Integer = 0 |
| While i < menu.Items.Count |
| If menu.Items(i).Text = "NoFilter" Or _ |
| menu.Items(i).Text = "Contains" Or _ |
| menu.Items(i).Text = "EqualTo" Or _ |
| menu.Items(i).Text = "GreaterThan" Or _ |
| menu.Items(i).Text = "LessThan" Then |
| i = i + 1 |
| Else |
| menu.Items.RemoveAt(i) |
| End If |
| End While |
| End Sub |