- I am using MS Visual Studio 2010 in a 3.5 environment.
- I am using Microsoft Vista (32 bit)
- The database is currently located on an SQL 2005 server.
- I am using RadGrid & tools, version 2012.1.411.35
- I am using both Chrome (18.0.1025.168) and Internet Explorer (8.0.7600.16385)
- I am programming in VB.net
I am usiing the radScheduler to display full day events that can last 1 or more days. I am setting the background and border colors for the items based on content. Where this is failing me is when the item continues to the next day. When this happens, the border and background disappear.
This only fails in Month View. In Day view the colors are there for each day. Week view draws the appointment across all days.
The attached image shows this to be the case for items 52 & 53 which should last from Jun 8th to Jun 15th. The database values driving the start and date are:
2012-06-08 00:00:00.000
2012-06-16 00:00:00.000
My Markup and code are below:
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Client/ClientPortal.master" CodeBehind="Summary.aspx.vb" Inherits="WorkNotifications.ClientSummary" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"HeaderTopPlaceholder"
runat
=
"server"
>
<
style
type
=
"text/css"
>a.HyperLink1{color:#57A6DC !important; font-style:italic;}</
style
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainPlaceholder"
runat
=
"server"
>
There are currently
<
ul
>
<
li
id
=
"btPending"
><
asp:Label
ID
=
"lblPending"
runat
=
"server"
Text
=
"# Pending Work Notifications"
></
asp:Label
></
li
>
<
li
id
=
"btApproved"
><
asp:Label
ID
=
"lblApproved"
runat
=
"server"
Text
=
"# Approved Work Notifications"
></
asp:Label
></
li
>
<
li
id
=
"btCompleted"
><
asp:Label
ID
=
"lblCompleted"
runat
=
"server"
Text
=
"# Completed Work Notifications"
></
asp:Label
></
li
>
</
ul
>
<
telerik:RadScheduler
TimelineView-UserSelectable
=
"False"
runat
=
"server"
ID
=
"RadScheduler1"
TimeZoneOffset
=
"00:00:00"
SelectedView
=
"MonthView"
OverflowBehavior
=
"Expand"
DataSourceID
=
"sqlSummary"
DataKeyField
=
"WN_ID"
DataStartField
=
"StartDate"
DataEndField
=
"EndDate"
DataSubjectField
=
"SubjectField"
DayStartTime
=
"8:00:00"
DayEndTime
=
"17:00:00"
AllowDelete
=
"false"
AllowEdit
=
"false"
AllowInsert
=
"False"
Skin
=
"Web20"
DataDescriptionField
=
"WN_Status"
>
<
AdvancedForm
Modal
=
"true"
/>
<
Reminders
Enabled
=
"true"
/>
<
TimeSlotContextMenuSettings
EnableDefault
=
"true"
/>
<
AppointmentContextMenuSettings
EnableDefault
=
"true"
/>
</
telerik:RadScheduler
>
<
asp:SqlDataSource
ID
=
"sqlSummary"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:WorkNotificationConnectionString %>"
SelectCommand="SELECT WN_ID, WN_Status, CONVERT(varchar, dbo.WorkNotifications.DisplayID) + CASE iteration WHEN 0 THEN '' ELSE ' rev. ' + CONVERT(varchar, Iteration) END + ': ' + dbo.WorkNotifications.Description + ' (' + dbo.WN_Status.WNS_Status + ')' AS SubjectField, ApproveByDateTime as StartDate, dateadd(day, 1, ApproveByDateTime) as EndDate FROM dbo.WorkNotifications LEFT OUTER JOIN dbo.WN_Status ON dbo.WorkNotifications.WN_Status = dbo.WN_Status.WNS_ID WHERE (DLBClientID = '2') AND (WN_Status = 3) AND (ArchivedForRevision = 0) UNION
SELECT WN_ID, WN_Status, CONVERT(varchar, dbo.WorkNotifications.DisplayID) + CASE iteration WHEN 0 THEN '' ELSE ' rev. ' + CONVERT(varchar, Iteration) END + ': ' + dbo.WorkNotifications.Description + ' (' + dbo.WN_Status.WNS_Status + ')' AS SubjectField, WorkStartDate as StartDate, dateadd(day, 1, WorkEndDate) as EndDate FROM dbo.WorkNotifications LEFT OUTER JOIN dbo.WN_Status ON dbo.WorkNotifications.WN_Status = dbo.WN_Status.WNS_ID WHERE (DLBClientID = '2') AND (WN_Status = 5) AND (ArchivedForRevision = 0) UNION
SELECT WN_ID, WN_Status, CONVERT(varchar, dbo.WorkNotifications.DisplayID) + CASE iteration WHEN 0 THEN '' ELSE ' rev. ' + CONVERT(varchar, Iteration) END + ': ' + dbo.WorkNotifications.Description + ' (' + dbo.WN_Status.WNS_Status + ')' AS SubjectField, DATEADD(dd, DATEDIFF(dd, 0, CompletedDate), 0) as StartDate, dateadd(day, 1, DATEADD(dd, DATEDIFF(dd, 0, CompletedDate), 0)) as EndDate FROM dbo.WorkNotifications LEFT OUTER JOIN dbo.WN_Status ON dbo.WorkNotifications.WN_Status = dbo.WN_Status.WNS_ID WHERE (DLBClientID = '2') AND (WN_Status = 6) AND (ArchivedForRevision = 0)">
</
asp:SqlDataSource
>
</
asp:Content
>
Imports
System.Data.SqlClient
Imports
System.Drawing
Public
Class
ClientSummary
Inherits
System.Web.UI.Page
Private
Sub
ClientSummary_Load(sender
As
Object
, e
As
System.EventArgs)
Handles
Me
.Load
Session(
"UserType"
) =
"Client"
Using connection
As
SqlConnection =
New
SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings(
"WorkNotificationConnectionString"
).ConnectionString)
Dim
cmd
As
New
SqlCommand()
cmd.Connection = connection
cmd.Connection.Open()
cmd.CommandText =
"SELECT COUNT(dbo.WorkNotifications.WN_ID) AS Total, dbo.WN_Status.WNS_ClientMode "
_
&
"FROM dbo.WorkNotifications LEFT OUTER JOIN "
_
&
"dbo.WN_Status ON dbo.WorkNotifications.WN_Status = dbo.WN_Status.WNS_ID "
_
&
"WHERE (dbo.WorkNotifications.ArchivedForRevision = 0) AND (dbo.WorkNotifications.DLBClientID = '2') "
_
&
"GROUP BY dbo.WN_Status.WNS_ClientMode"
Dim
dr
As
SqlDataReader = cmd.ExecuteReader
While
dr.Read
Select
Case
dr.Item(
"WNS_ClientMode"
)
Case
"Pending"
If
dr.Item(
"Total"
) = 1
Then
lblPending.Text =
"1 Pending Work Notification"
Else
lblPending.Text = dr.Item(
"Total"
) &
" Pending Work Notifications"
End
If
Case
"Approved"
If
dr.Item(
"Total"
) = 1
Then
lblApproved.Text =
"1 Approved Work Notification"
Else
lblApproved.Text = dr.Item(
"Total"
) &
" Approved Work Notifications"
End
If
Case
"Completed"
If
dr.Item(
"Total"
) = 1
Then
lblCompleted.Text =
"1 Completed Work Notification"
Else
lblCompleted.Text = dr.Item(
"Total"
) &
" Completed Work Notifications"
End
If
End
Select
End
While
dr.Close()
End
Using
End
Sub
Private
Sub
RadScheduler1_AppointmentClick(sender
As
Object
, e
As
Telerik.Web.UI.SchedulerEventArgs)
Handles
RadScheduler1.AppointmentClick
Response.Redirect(
"../WN.aspx?WN_ID="
& e.Appointment.ID.ToString)
End
Sub
Private
Sub
RadScheduler1_AppointmentDataBound(sender
As
Object
, e
As
Telerik.Web.UI.SchedulerEventArgs)
Handles
RadScheduler1.AppointmentDataBound
If
e.Appointment.Description <>
Nothing
Then
Select
Case
e.Appointment.Description.ToString
Case
3
'Unapproved
e.Appointment.BackColor = Color.Gold
e.Appointment.BorderColor = Color.DarkGoldenrod
Select
Case
e.Appointment.Description.ToString
Case
3
e.Appointment.CssClass =
"AppBackGround"
End
Select
Exit
Select
Case
5
'DLB & Client Approved
e.Appointment.BackColor = Color.PaleGreen
e.Appointment.BorderColor = Color.DarkGreen
Exit
Select
Case
6
'Completed
e.Appointment.BackColor = Color.Gainsboro
e.Appointment.ForeColor = Color.DimGray
e.Appointment.BorderColor = Color.DarkGray
Exit
Select
Case
Else
Exit
Select
End
Select
End
If
End
Sub
End
Class