472,986 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

ASP.Net Calendar - Default height/width?

Hi All,

I am using the <asp: Calendar> object. In the OnDayRender event handler
I am putting text into certain day boxes, and leaving others blank. The
effect is that some months have no additonal text rendered, some months
will have 2 weeks(rows) with no additional content and 1 week with 2 or
3 rows of rendered text. Essentially, the size of the Calendar
fluctuates depending on the data im rendering.

Setting the width property is not a problem and solves the fluctuation
on that axis; however, if I set the height property to, say, 500, then
on a month with 3 blank rows and 1 row with 5 lines of text, the other
rows get squished down .... If I dont specify the height, then the
whole calendar goes tiny on months with no data.

At no point will any row have to hold more than 5 lines of 8pt text.

What I am thinking would be the perfect fix is if I could specify that
every row of the calendar table default to 5 lines of height no matter
what ... then the calendar would always keep a uniform size.

Problem is, not sure how to do that.

Appreciate any input, thanks

Dec 20 '05 #1
2 4630
This probably depends on the way you're adding your rows to each day cell.
My two suggestions would be:

1) Create a panel object that you will add to each day cell. For the days
without anything, you would simply add the following to your panel control:

CalPanel.Controls.Add("&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br
/>&nbsp;");

2) Create a table control that will have 5 rows with each of your blank rows
set as follows:

trCalendar = new TableRow();
tcCalendar = new TableCell();
tcCalendar.Text = "&nbsp;";
trCalendar.Cells.Add(tcCalendar);
tblCalendar.Rows.Add(trCalendar);

This assumes that you will only be using one column within the table.

With either one of these, you can create a user control to handle the
details so that your main application will only be concerned with adding
content to the non-blank rows.

Hope this helps!
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

<to********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi All,

I am using the <asp: Calendar> object. In the OnDayRender event handler
I am putting text into certain day boxes, and leaving others blank. The
effect is that some months have no additonal text rendered, some months
will have 2 weeks(rows) with no additional content and 1 week with 2 or
3 rows of rendered text. Essentially, the size of the Calendar
fluctuates depending on the data im rendering.

Setting the width property is not a problem and solves the fluctuation
on that axis; however, if I set the height property to, say, 500, then
on a month with 3 blank rows and 1 row with 5 lines of text, the other
rows get squished down .... If I dont specify the height, then the
whole calendar goes tiny on months with no data.

At no point will any row have to hold more than 5 lines of 8pt text.

What I am thinking would be the perfect fix is if I could specify that
every row of the calendar table default to 5 lines of height no matter
what ... then the calendar would always keep a uniform size.

Problem is, not sure how to do that.

Appreciate any input, thanks

Dec 21 '05 #2
Thanks Chris, I think #1 is the perfect solution.

Funny thing is I mentioned this problem to my wife. She was like, "just
click on the small boxes and push enter 5 times." Its always the
simplest solution that eludes us the most!!

Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: vinu | last post by:
I have a javascript file named select.js. This is a file which is use to pop up a calendar, when clicked on a calendar icon in an ASP file. have a close button in the calendar. When i click on the...
19
by: Stimp | last post by:
preferably one that when clicked can update three date dropdowns (day, month, year) like http://www.visitdublin.com/carhire/avis.asp Don't mind paying for the file... anyone seen something...
0
by: maxrawson | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many...
2
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many...
0
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error:...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.