?
Solved

How to create a VB.Net Calendar that shows a Information(a pos. or neg. number) along with the day

Posted on 2011-09-27
2
Medium Priority
?
194 Views
Last Modified: 2012-05-12
I have a problem where I have to create a calendar in ASP.net(VB.net) where the day(number) is posted
off to the corner of each block in the calendar, and in the center of each block is a number,
preferrably a font size no smaller than 28(48 or 72 would be fine), that is pulled from an SQL2005 table, the
number will be either positive or negative(-##).  Also if possible, the calendar day should change colors if
the number is negative (Attached is an example of what it looks like in Excel, which we are now using). I need this as soon as possible, so any help would be greatly appreciated. Calendar-ex.doc
0
Comment
Question by:djerome2
[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
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1500 total points
ID: 36717326
You can customize the way that the ASP.NET Calendar renders, by handling the DayRender event, and customizing each cell.

Example:

Cool Tricks With The ASP.net Calendar
http://weblogs.sqlteam.com/jhermiz/archive/2007/12/10/Cool-Tricks-With-The-ASP.net-Calendar.aspx
Protected Sub Calendar13_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar13.DayRender
 	 Dim onmouseoverStyle As String = "this.style.backgroundColor='#D4EDFF'"
	 Dim onmouseoutStyle As String = "this.style.backgroundColor='@BackColor'"
	 Dim rowBackColor As String = String.Empty
            
	 e.Cell.Attributes.Add("onmouseover", onmouseoverStyle)
	 e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor))
    
     If Not e.Day.IsWeekend Then
                e.Cell.Attributes.Add("onmouseover", onmouseoverStyle)
                e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor))
     End If
 End Sub

Open in new window

0
 

Author Closing Comment

by:djerome2
ID: 36906593
Solution was not complete, but it did help to point me in the right direction. For that alone, and for being the only one brave enough to even give it a go, I award all points to you.
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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

771 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