Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 377843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:44:08+00:00 2026-05-12T14:44:08+00:00

I am doing a report to display the records in Grid view based on

  • 0

I am doing a report to display the records in Grid view based on some search parameters. In that one search filter is Drop down with Year values. The drop down should contain the years starting from 2000 to current year. If the year changes it should automatically bind the next year.
How can I achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:44:09+00:00Added an answer on May 12, 2026 at 2:44 pm

    May I’m not understanding your question right, but it looks like you’re just ‘binding’ a simple drop down to some year values. If that’s the case, i would put the following into your Page_Load

    if (!IsPostBack)
    {
      for(int i = 2000, i <= DateTime.Now.Year; i++)
      {
        MyDropDownList.Items.Add(i.ToString());
      }
      //Select the current year initially
      MyDropDownList.SelectedIndex = MyDropDownList.Items.Count - 1;
    }
    
    //Later on in your Page_Load
    MyGridView.DataSource = MyMethodOfFetchingData(MyDropDownList.SelectedValue);
    MyGridView.DataBind();
    

    At that point you need to use MyDropDownList.SelectedValue when retrieving your data to be displayed.

    EDIT:
    Added default selection of current year.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a progress bar while doing some work, but that would
I use the MFC list control in report view with grid lines to display
I am doing a sql server report that shows running daily, monthly, and yearly
Recently I updated a Crystal Report that was doing all of its work on
I am trying to write a view that will generate a report which displays
i'm currently doing some reports for SSRS, and i just confirm what i already
We are doing a conversion of Crystal Reports to SSRS. One thing we noticed
Doing some ETL and I have a wide file with lots of cols, for
Doing my first SL4 MVVM RIA based application and i ran into the following
Using report Builder 7.x I am trying to format a TDBText to display postive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.