Hi Dan,
Thank you for answering to my earlier questions all
Help again:
1) Events not displaying when change the calendar date (if the control inside the table cell). Please refer below working and not working function for your reference. We are aligning the control in vertically hence using table.
2) Is it possible to increase the cell height if got event?
3) Not resizing when resize the event
private void working()
{
Session["sesUserId"] = "fsafs";
string sUserID = Session["sesUserId"].ToString();
string sQuery;
// Table table;
TableRow tr;
TableRow trl;
TableCell tc;
TableCell tclbl;
DayPilotCalendar dpc;
Label lbl;
//table = new Table();
//tblDayCal.EnableViewState = true;
//table.ID = "table";
tblDayCal.BorderStyle = BorderStyle.None;
//this.form1.Controls.Add(tblDayCal);
tr = new TableRow();
trl = new TableRow();
// Getting User calendar access
dsUserCal = ExcuteSQL(sQuery);
// Getting list of events date(s) by accessable user(s)
dsG = ExcuteSQL(sQuery);
GetUserEvents(sUserID, DayPilotCalendar1);
tc = new TableCell();
tclbl = new TableCell();
lbl = new Label();
lbl.Font.Bold = true;
lbl.ForeColor = Color.Green;
lbl.EnableViewState = true;
lbl.ID = "lbCalendar" ;
lbl.Text = "Please select a day";
tclbl.BackColor = Color.YellowGreen;
//tclbl.Controls.Add(lbl);
tc.VerticalAlign = VerticalAlign.Top;
//tc.Controls.Add(Calendar1);
trl.Cells.Add(tclbl);
tr.Cells.Add(tc);
tc = new TableCell();
tclbl = new TableCell();
lbl = new Label();
lbl.Font.Bold = true;
lbl.EnableViewState = true;
lbl.ID = "lbRootCal";
lbl.Text = "Root User";
tclbl.BackColor = Color.YellowGreen;
tclbl.Controls.Add(lbl);
//tc.Controls.Add(DayPilotCalendar1);
trl.Cells.Add(tclbl);
tr.Cells.Add(tc);
foreach (DataRow dr in dsUserCal.Tables[0].Rows)
{
//tc = new TableCell();
//tclbl = new TableCell();
dpc = new DayPilot.Web.Ui.DayPilotCalendar();
dpc.Width = 500;
dpc.ID = "dpc" + dr["CalUserId"].ToString();
dpc.EventEditHandling = DayPilot.Web.Ui.Enums.UserActionHandling.JavaScript;
this.form1.Controls.Add(dpc);
GetUserEvents(dr["CalUserId"].ToString(), dpc);
lbl = new Label();
lbl.Font.Bold = true;
tclbl.BackColor = Color.YellowGreen;
lbl.EnableViewState = true;
lbl.ID = "Label" + dr["CalUserId"].ToString();
lbl.Text = dr["UserName"].ToString();
//tclbl.Controls.Add(lbl);
//tc.Controls.Add(dpc);
//trl.Cells.Add(tclbl);
//tr.Cells.Add(tc);
}
//tblDayCal.Rows.Add(trl);
//tblDayCal.Rows.Add(tr);
}
private void NotWorking()
{
Session["sesUserId"] = "fsafs";
string sUserID = Session["sesUserId"].ToString();
string sQuery;
Table tblDayCal;
TableRow tr;
TableRow trl;
TableCell tc;
TableCell tclbl;
DayPilotCalendar dpc;
Label lbl;
tblDayCal = new Table();
//tblDayCal.EnableViewState = true; (true/false both are not working)
//table.ID = "table";
tblDayCal.BorderStyle = BorderStyle.None;
this.form1.Controls.Add(tblDayCal);
tr = new TableRow();
trl = new TableRow();
// Getting User calendar access
dsUserCal = ExcuteSQL(sQuery);
// Getting list of events date(s) by accessable user(s)
dsG = ExcuteSQL(sQuery);
GetUserEvents(sUserID, DayPilotCalendar1);
tc = new TableCell();
tclbl = new TableCell();
lbl = new Label();
lbl.Font.Bold = true;
lbl.ForeColor = Color.Green;
lbl.EnableViewState = true;
lbl.ID = "lbCalendar";
lbl.Text = "Please select a day";
tclbl.BackColor = Color.YellowGreen;
tclbl.Controls.Add(lbl);
tc.VerticalAlign = VerticalAlign.Top;
tc.Controls.Add(Calendar1);
trl.Cells.Add(tclbl);
tr.Cells.Add(tc);
tc = new TableCell();
tclbl = new TableCell();
lbl = new Label();
lbl.Font.Bold = true;
lbl.EnableViewState = true;
lbl.ID = "lbRootCal";
lbl.Text = "Root User";
tclbl.BackColor = Color.YellowGreen;
tclbl.Controls.Add(lbl);
tc.Controls.Add(DayPilotCalendar1);
trl.Cells.Add(tclbl);
tr.Cells.Add(tc);
foreach (DataRow dr in dsUserCal.Tables[0].Rows)
{
tc = new TableCell();
tclbl = new TableCell();
dpc = new DayPilot.Web.Ui.DayPilotCalendar();
dpc.Width = 500;
dpc.ID = "dpc" + dr["CalUserId"].ToString();
dpc.EventEditHandling = DayPilot.Web.Ui.Enums.UserActionHandling.JavaScript;
this.form1.Controls.Add(dpc);
GetUserEvents(dr["CalUserId"].ToString(), dpc);
lbl = new Label();
lbl.Font.Bold = true;
tclbl.BackColor = Color.YellowGreen;
lbl.EnableViewState = true;
lbl.ID = "Label" + dr["CalUserId"].ToString();
lbl.Text = dr["UserName"].ToString();
tclbl.Controls.Add(lbl);
tc.Controls.Add(dpc);
trl.Cells.Add(tclbl);
tr.Cells.Add(tc);
}
tblDayCal.Rows.Add(trl);
tblDayCal.Rows.Add(tr);
}