Search This Blog

Friday, November 30, 2012

Calendar show text place of date in c#


       
Calendar show text place of date.
//***********************************day render create cell load time**********
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
if (dr.Read())
                {
                    int i;
                    for (i = 1; i <= 31; i++)
                    {
                        if (e.Day.Date.Day == i)
                        {
                            if (dr["D" + i].ToString() == "1")
                            {
e.Cell.Text = "P";
                            }
                            else if (dr["D" + i].ToString() == "0")
                            {
                               e.Cell.Text = "A";
    }
                            else if (dr["D" + i].ToString() == "2")
                            {
e.Cell.Text = "H";                      
          }
                            else
                            {
                                e.Cell.BackColor = Color.White;
                          }
                      }
                  }
   }
            }
            else

 { e.Cell.Text = ""; }

No comments :