Customizing Calendar control

N

Neven Klofutar

Hi,

I'm trying to customize Calendar control. I would like to create XX Buttons
as Controls in a Cell of the selected Day.
I succesfully added Buton, but I just can't get it to work with it's Command
event.

Please help, Neven

******************************************************
private void Calendar1_DayRender_1(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e) {

// date is selected
if (e.Day.IsSelected) {

// clear controls
e.Cell.Controls.Clear();

// create button 1
Button button1 = new Button();
button1.Text = "09:00";
button1.Command += new CommandEventHandler(DoStuff);
// add button
e.Cell.Controls.Add(button1);

}
}

private void DoStuff(object sender, CommandEventArgs e) {
label.Text = "test";
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top