Welcome Guest Search | Active Topics | Sign In | Register

Custom Text in Calendar Days Options
jprose
Posted: Friday, June 8, 2007 9:59:19 AM
Rank: Newbie
Groups: Member

Joined: 6/8/2007
Posts: 2
Hello,

I've been tasked with using the Calendar control to create an event scheduling application. I'm having trouble getting my own custom text to render in the cells of the calendar using the DayRender event. I'm certain this is relatively easy, but I'm not seeing exactly how to accomplish it.

Does anyone have a code sample (C#) that could give a me a steer in the right direction?

Thanks in advance,
JP
eo_support
Posted: Friday, June 8, 2007 10:11:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

It will be something like this for a standard textbox:

Code: C#
private void Calendar1_DayRender(
    object sender, EO.Web.DayRenderEventArgs e)
{
    TextBox tb = new TextBox();
    tb.RenderControl(e.Writer);
}


Note this only works if you don't have any special logic that relies on other events in the control's life cycle. Some controls rely on Load or PreRender stage to perform certain things and those will likely to fail. Also if your control needs to be a child of the Page in order to render correctly you would also see problems. For those scenarios, you would need to dig into your control's source code and see how you can get around those.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.