Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
198 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

Independent Software Vendors: 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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

636 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