0

hi every one,i have one problem with DateTimePicker,
i am displaying only years in dtp by setting custom Format property to yyyy and dtp format to custom and showupdown property to true.
the problem is when i click once down arrow or up arrow the years in dtp continuously changing i.pls help me

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by tatarao25
0

In This ValueChanged
i weitten following code

try
            {
              
                string[] Month = new string[12] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
                dataSetAquaCity.YearlyReport.Rows.Clear();
                for (int i = 1; i <= 12; i++)
                {
                    if (radDtpDate.Value.Year == DateTime.Now.Year && DateTime.Now.Month < i)
                    {
                        break;
                    }
                    else
                        yearlyReportTableAdapter.Fill(dataSetAquaCity.YearlyReport, Month[i - 1], int.Parse(cmbCustDistReff.SelectedValue.ToString()), Convert.ToDateTime((radDtpDate.Value.Year.ToString() + "/" + i + "/1")), Convert.ToDateTime((radDtpDate.Value.Year).ToString() + "/" + i + "/1"));
                }
                ReportDocument rptDocBill = new ReportDocument();
                if (dataSetAquaCity.YearlyReport.Rows.Count != 0)
                {
                    rptDocBill.Load("CrystalReports/YeralyPaymentReport.rpt");
                    rptDocBill.SetDataSource(dataSetAquaCity);
                    crpYearlySales.ReportSource = rptDocBill;
                }
                else
                {
                    crpYearlySales.ReportSource = null;
                    MessageBox.Show("No Records For Printing...");
                }

            }
            catch (Exception ex)
            { }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.