473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 4667
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.