Solved

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

Posted on 2008-10-24
7
689 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 500 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 500 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 500 total points
ID: 22809859
0
 

Author Closing Comment

by:CharlieDev
ID: 31509649
Thanks :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

630 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