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

Recommended Answers

All 2 Replies

What event handlers have you created and what code is in them?

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)
            { }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.