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";
}
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";
}