Click here to Skip to main content
15,040,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys I need your help. How to create a dynamic calendar in C#.net in such a way that I can enter my alerts regarding birthdays ,any events and any reminders about my daily tasks which have to be done in my daily schedule in the cells of the calendar on some particular dates dynamically .

I wrote below code.It isn't working.
C#
DataTable dt = SystemManager.DataBase.ExecuteQuery("", "sphrm_EmployeeBirthDay_SEL").Tables[0];
        gridControl1.DataSource = dt;
 DateTime dtEnd = DateTime.Now;
        dtEnd = dtEnd.AddDays(15);
        for (DateTime dt = DateTime.Now; dt <= dtEnd; dt = dt.AddDays(1))
        {
            string str = "";
            str = dt.Year.ToString() + " year " + dt.Month.ToString() + " month ";

            if (Month != str)
            {
                band = bandedGridView2.Bands.AddBand(str);
                band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                band.AppearanceHeader.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
                band.AppearanceHeader.Font = new Font("Tahoma", 8, FontStyle.Bold);
            }
            BandedGridColumn column = (BandedGridColumn)bandedGridView2.Columns.AddField("F" + dt.Year.ToString() + "_" + dt.Month.ToString() + "_" + dt.Day.ToString());
            RepositoryItemPictureEdit repositoryItemPictureEdit1 = new RepositoryItemPictureEdit();
            column.ColumnEdit = repositoryItemPictureEdit1;
            string Days = "";
            if (dt.Day.ToString().Length == 1)
                Days = "0" + dt.Day.ToString();
            else
                Days = dt.Day.ToString();
            column.Caption = dt.DayOfWeek.ToString().Substring(0, 2) + "   " + Days;
            column.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            column.AppearanceHeader.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            column.AppearanceHeader.Font = new Font("Tahoma", 8, FontStyle.Bold);
            column.OwnerBand = band;
            column.Visible = true;
            column.Width = 38;
            column.OptionsColumn.AllowEdit = false;
            Month = str;
        }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900