Solved

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

Posted on 2008-10-24
7
686 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
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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