?
Solved

calendar object in c# asp.net styling properties adding a gridlines and no border

Posted on 2008-10-24
7
Medium Priority
?
691 Views
Last Modified: 2012-05-05
Hi,

I have a calendar in an asp.net page and would like to add gridlines around each date and remove the border and also if possible add a darker line between friday and saturday as shown in the proposed calendar file. Can anyone assist me with this?

Thanks

<asp:Calendar id="Calendar1"
                     OnSelectionChanged="Date_Selected"
                     width="429px"
                     height="280px"
                     Font-Name="Verdana" 
                     Font-Size="16px"
                     padding-left="5px"
                     NextPrevFormat="ShortMonth"
                     border-style="none"
                     text-decoration="none"
                     runat="server">
                   <TodayDayStyle />
                   <DayHeaderStyle Font-Bold="True"/>
                   <OtherMonthDayStyle ForeColor="gray"/>
                   <TitleStyle BackColor="#ffffff"
                               ForeColor="#000"
                               Font-Bold="True"/>
 
                   <SelectedDayStyle BackColor="#336633"
                                     Font-Bold="True"
                                     />
                   <NextPrevStyle ForeColor="#000"
                                  Font-Size="12px"/>
                   <SelectorStyle BackColor="#336633" 
                                  ForeColor="navy"
                                  Font-Size="9px"/>
                </asp:Calendar>

Open in new window

calendar1.jpg
proposedcalendar.jpg
0
Comment
Question by:CharlieDev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 2000 total points
ID: 22796454
something like this?
<asp:Calendar ID="Calendar1" runat="server" BorderStyle="Double" BorderWidth="4px" BorderColor="green" DayStyle-BorderStyle="Solid" DayStyle-BorderWidth="1px" Font-Names="Verdana" Font-Size="16px" Height="280px" NextPrevFormat="ShortMonth" Width="429px">
	<TodayDayStyle />
	<DayHeaderStyle Font-Bold="True" />
	<OtherMonthDayStyle ForeColor="gray" />
	<TitleStyle BackColor="#ffffff" Font-Bold="True" ForeColor="#000" />
	<SelectedDayStyle BackColor="#336633" Font-Bold="True" />
	<NextPrevStyle Font-Size="12px" ForeColor="#000" />
	<SelectorStyle BackColor="#336633" Font-Size="9px" ForeColor="navy" />
</asp:Calendar>

Open in new window

0
 

Author Comment

by:CharlieDev
ID: 22796835
Great thanks, just one last thing, can I get rid of the underline on each day i've tried text-decoration="none" but it hasnt had any effect.

cheers
0
 

Author Comment

by:CharlieDev
ID: 22797006
Sorry another thing, is it possible to make the days that have already passed to be grey and the current day and days to come to stay black?

Many thanks
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 2000 total points
ID: 22797657
removing the hyperlink i have no idea but as far as older/past dates are concerned you an override the dayrendered event
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.calendar.dayrender.aspx
0
 

Author Comment

by:CharlieDev
ID: 22807945
Thanks, I'm very new to all this , could you possibly give a bit of an example as to how I would use this?
Does the " public event DayRenderEventHandler DayRender " bit control the calendar automatically, so I could write some code in there to get datetime now and then find all dates before the current date and set the background of those to be a different color? Do I have the right idea?
Cheers
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 2000 total points
ID: 22809859
0
 

Author Closing Comment

by:CharlieDev
ID: 31509649
Thanks :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question