Hi All,
I am Doing Calendar Events.
I am getting my events from Database.
I U Observe The Image U can understand that the events are with Green Colored.
E.g., like 1,2,3,4,6,7 & 8.
My Task Is that When My cursor would be placed on 1 & when I click on that 1 it wants to be opened new page.
Here When I am keeping my cursor on 1 the background Is changing with Red & Fore color is changing to White I u observe the Image.
But My Problem is that it was not getting Link That means when I keep the cursor on day 1 cell it cant change like HAND SYMBOL.
If I get HAND SYMBOL At that place my work gets simple.
My Image Is,

Please check my code if there is any mistakes,
My Code Goes Like This,
protected void EventsCalendar_DayRender(object sender, DayRenderEventArgs e)
{
string onmouseoverStyle = "this.style.backgroundColor='Red';this.style.color='White'";
string onmouseoutStyle = "this.style.backgroundColor='#F0F7EF';this.style.color='Green'";
e.Cell.Enabled = false;
DataSet ds = GetEventsCalendarDetails();
string link = "<a href='EventScheduleDetails.aspx?EventID=";
string s = e.Day.Date.ToShortDateString();
e.Cell.Text = e.Day.Date.Day.ToString() + "<BR>";
LinkButton l = new LinkButton();
l.Text = e.Day.Date.Day.ToString() + "<BR>";
e.Cell.Controls.Add(l);
if (ds != null)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow row in ds.Tables[0].Rows)
{
int EventID = Convert.ToInt32(row["EventID"]);
string EventTitle = row["Title"].ToString();
string EventStartDate = Convert.ToDateTime(row["StartDate"]).ToShortDateString();
string EventEndDate = Convert.ToDateTime(row["EndDate"]).ToShortDateString();
if (EventStartDate.Equals(s))
{
e.Cell.Enabled = true;
e.Cell.ForeColor = System.Drawing.Color.Green;
e.Cell.Style.Add("background-color", "#F0F7EF");
LinkButton lnk = new LinkButton();
lnk.Text = link + (int)row["EventID"] + "'>";
lnk.Attributes.Add("onclick", "window.open('" + link + "');");
e.Cell.Controls.Add(lnk);
e.Cell.Attributes.Add("onmouseover", onmouseoverStyle);
e.Cell.Attributes.Add("onmouseout", onmouseoutStyle);
}
}
}
}
}
}
Thanks In Advance,
VenkiDesai.