Solved

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

Posted on 2008-10-24
7
676 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
  • 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now