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
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
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
|