Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Clearing the days of anydata

Reply
Thread Tools

Clearing the days of anydata

 
 
Ron Harter
Guest
Posts: n/a
 
      07-02-2009


I am new to ASP .Net and still learning so please bear with me. I have a
calendar control where I need the days that are not part of the current
month to be empty. I can't find anything in the documentation on how to do
this so I ended up setting the foreground and background color to be the
same for the OtherMonthDayStyle. Data is still being rendered in the cell
for that day but it is invisible.

This seems kludgey to me and I was wondering of anyone has a cleaner way to
not show anything.



-----
Ron Harter | Tongue, Tied and Twisted
http://www.velocityreviews.com/forums/(E-Mail Removed) | Just An Earthbound Misfit ... I
| Pink Floyd

 
Reply With Quote
 
 
 
 
Stan
Guest
Posts: n/a
 
      07-05-2009
On 3 July, 00:39, "Ron Harter" <(E-Mail Removed)> wrote:
> I am new to ASP .Net and still learning so please bear with me. I have a
> calendar control where I need the days that are not part of the current
> month to be empty. I can't find anything in the documentation on how to do
> this so I ended up setting the foreground and background color to be the
> same for the OtherMonthDayStyle. Data is still being rendered in the cell
> for that day but it is invisible.
>
> This seems kludgey to me and I was wondering of anyone has a cleaner way to
> not show anything.
>
> -----
> Ron Harter * * * * * * * * * * | Tongue, Tied and Twisted
> (E-Mail Removed) | Just An Earthbound Misfit ... I
> * * * * * * * * * * * * * * * * * * * * | * * * * * * * Pink Floyd


Try this in the RenderDay event

if (e.Day.IsOtherMonth)
{
e.Cell.Controls.Clear(); // remove the date selector link
button
e.Cell.Text = "&nbsp;"; // insert a placeholder for the
empty cell
}

Note that since the calendar is rendered as a table, the empty cell
must contain something to preserve the structure. Hence the &nbsp;
character (non-break space).
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DBD::AnyData hangs when exporting XML KomsBomb@hotmail.com Perl Misc 5 06-23-2007 04:25 AM
Calculating days using Business Days for the Calendar David Stockwell Python 2 09-20-2004 09:58 PM
Re: Calculating days using Business Days for the Calendar Gerrit Python 0 09-20-2004 04:39 PM
XML, DBI::AnyData and mySQL Federico Bari XML 0 01-28-2004 06:32 AM
XML, DBI::AnyData and mySQL Federico Bari Perl Misc 0 01-27-2004 06:27 PM



Advertisments