Create the database as follow

Currently i have my database as practice.here i am adding a table as Events.The events table look like as follow.
In this table i have 2 columns
- one is Events
- one is Date of that events.
Click its smart tag for better look and feel of the calender. This will be done as follow.

Increase the height and width of the calender. Go to the .cs page and write the following code in Calender DayRender event.
What is DayRender Event ?
A-calendar DayRender event occurs when each day is created in the control hierarchy of the calendar control. DayRender event is raised when each date cell in the calendar control is created.
- protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
- {
- Literal l = new Literal(); //Creating a literal
- l.Visible = true;
- l.Text = "<br/>"; //for breaking the line in cell
- e.Cell.Controls.Add(l); //adding in all cell
- da = new SqlDataAdapter("select * from Events", con);
- DataTable dt = new DataTable();
- da.Fill(dt);
- foreach(DataRow dr in dt.Rows)
- {
- string x = dr[1].ToString();
- if (dr[1].ToString() == e.Day.Date.ToString()) //comparision
- {
- Label lb = new Label();
- lb.Visible = true;
- lb.Text = dr[0].ToString();
- string a = lb.Text;
- e.Cell.Controls.Add(lb);
- e.Cell.BackColor = System.Drawing.Color.OrangeRed; // changing cell color
- e.Cell.ToolTip = dr[0].ToString(); //adding tooltip
- }
- }
- }
Now it gives the result as follow, binding all events from db table to the Calender.

Bartolomeu LemosPosted Feb 19, 2019, 6:54 AM
Is possible post download code? Tks and Congratulations.