473,725 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weekly view for Calendar control or 3rd Party component

Hello.

I am using the ASP.NET calendar object and am looking to provide a "weekly
view", but not the typical "Outlook" style. Rather, I just want it to render
the calendar normally, but only display the current week and not any of the
other weeks within the given month.

If this isn't possible with the built-in component, has anyone else solved
this issue with a third party component?

Thanks in advance.
Apr 3 '06 #1
2 2365
Hi Brenden,

I'm not sure if this is what you're after, but it was a fun little project.

If it's what you're after, let us know?

Ken
Microsoft MVP [ASP.NET]
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
Dim dt As DateTime
dt = Now
Calendar1.Visib leDate = dt
Calendar1.Selec tedDate = dt
End Sub

Public Shared Function Week _
(ByVal tdDate As System.DateTime ) As Integer
Dim myCI As New Globalization.C ultureInfo("en-US")
Dim myCal As Globalization.C alendar = myCI.Calendar
Dim myCWR As Globalization.C alendarWeekRule = _
myCI.DateTimeFo rmat.CalendarWe ekRule
Dim myFirstDOW As DayOfWeek = _
myCI.DateTimeFo rmat.FirstDayOf Week
Return myCal.GetWeekOf Year(tdDate, myCWR, myFirstDOW)
End Function

Protected Sub Calendar1_DayRe nder _
(ByVal sender As Object, _
ByVal e As System.Web.UI.W ebControls.DayR enderEventArgs)
If Week(e.Day.Date ) <> Week(Calendar1. SelectedDate) Then
e.Cell.Text = ""
End If
End Sub


</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:calendar id="Calendar1" runat="server"
ondayrender="Ca lendar1_DayRend er"></asp:calendar>

</div>
</form>
</body>
</html>

"Brenden Bixler" <Br***********@ discussions.mic rosoft.com> wrote in message
news:8E******** *************** ***********@mic rosoft.com...
Hello.

I am using the ASP.NET calendar object and am looking to provide a "weekly
view", but not the typical "Outlook" style. Rather, I just want it to
render
the calendar normally, but only display the current week and not any of
the
other weeks within the given month.

If this isn't possible with the built-in component, has anyone else solved
this issue with a third party component?

Thanks in advance.

Apr 3 '06 #2
Thank you Ken.

That was what I was trying to achieve. I should be able to modify your
example to meet my needs.

Much appreciated.

-Brenden

"Ken Cox - Microsoft MVP" wrote:
Hi Brenden,

I'm not sure if this is what you're after, but it was a fun little project.

If it's what you're after, let us know?

Ken
Microsoft MVP [ASP.NET]
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
Dim dt As DateTime
dt = Now
Calendar1.Visib leDate = dt
Calendar1.Selec tedDate = dt
End Sub

Public Shared Function Week _
(ByVal tdDate As System.DateTime ) As Integer
Dim myCI As New Globalization.C ultureInfo("en-US")
Dim myCal As Globalization.C alendar = myCI.Calendar
Dim myCWR As Globalization.C alendarWeekRule = _
myCI.DateTimeFo rmat.CalendarWe ekRule
Dim myFirstDOW As DayOfWeek = _
myCI.DateTimeFo rmat.FirstDayOf Week
Return myCal.GetWeekOf Year(tdDate, myCWR, myFirstDOW)
End Function

Protected Sub Calendar1_DayRe nder _
(ByVal sender As Object, _
ByVal e As System.Web.UI.W ebControls.DayR enderEventArgs)
If Week(e.Day.Date ) <> Week(Calendar1. SelectedDate) Then
e.Cell.Text = ""
End If
End Sub


</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:calendar id="Calendar1" runat="server"
ondayrender="Ca lendar1_DayRend er"></asp:calendar>

</div>
</form>
</body>
</html>

"Brenden Bixler" <Br***********@ discussions.mic rosoft.com> wrote in message
news:8E******** *************** ***********@mic rosoft.com...
Hello.

I am using the ASP.NET calendar object and am looking to provide a "weekly
view", but not the typical "Outlook" style. Rather, I just want it to
render
the calendar normally, but only display the current week and not any of
the
other weeks within the given month.

If this isn't possible with the built-in component, has anyone else solved
this issue with a third party component?

Thanks in advance.


Apr 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8334
by: fig000 | last post by:
Hi, I have an application that's running fine on development servers (web and database-sql server 2000). I'm updating a record through a third party component but I don't think the component is the problem. What's happening is that I'm updating fields that are part of view. I'm only updating fields in one table of the view and this works fine in the development environment.
1
4171
by: Norman Fritag | last post by:
Hi there I have avoided to use active x controls because I thought they are causing more problems then they are doing any good. I a new application I would want to use the tree and list view control in access 2002. Prior to that I like to fine some information or here some feed back from developers who have use active x controls success fully in there application, what their experience was.
3
1190
by: Luis E Valencia | last post by:
I have a table that says for example 01/05/2004 Party IIsadpaks 01/06/2004 Party 2394923423 A events table. I want to make a calendar and that the days that are events are inbold and with a link to a detail of the events of that day.
0
1744
by: maxrawson | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many controls (i.e. roundedcorners component www.4guysfromrolla.com], buttons and panels) functions like a tab control. The buttons are programmatically designed to make the corresponding panel visible. Sample aspx.vb code:
2
3412
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many controls (i.e. roundedcorners component www.4guysfromrolla.com], buttons and panels) functions like a tab control. The buttons are programmatically designed to make the corresponding panel visible. Sample aspx.vb code:
5
2301
by: Peter | last post by:
Is it possible to span / display a graphic in the web calendar control that spans more than one cell / day? Does anyone have an example of this? Thanks Peter
2
4129
by: Paul | last post by:
I am using the standard Calendar control in ASP.Net 2.0 and VB.Net and VS2005. Here is the code: <asp:calendar id="cldr_contract_date" runat="server" backcolor="#ffffff" width="250px" height="200px" font-size="12px" font-names="Arial" borderwidth="2px" bordercolor="#000000" nextprevformat="shortmonth" daynameformat="firsttwoletters" OnSelectionChanged="cldr_SelectionChanged"> <titlestyle font-size="14px" font-bold="true"...
1
3731
by: Paul H | last post by:
Can anyone give me some pointers as to how to construct a form or forms that will allow me to see a schedule of meeting rooms Booked or Available as a nice visual display. The Query that holds the data for the schedule will have the following fields: RoomName, StartDate, EndDate, BookedBy. It needs to look a bit like the Outlook calendar (not all users have Outlook), I do not need to see the times that rooms are booked/available, I just...
1
3461
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i have to made in my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"...
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.