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

  • Home
  • SEARCH
  • 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 8363999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:19:38+00:00 2026-06-09T12:19:38+00:00

I have a form where there are two dropdown lists that are populated from

  • 0

I have a form where there are two dropdown lists that are populated from the same dataset, so their values should be equal. I have the OnSelectedIndexChanged event in code and the AutoPostBack set to true for the second drop down. The behavior expected is that when a user selects an item from the second dropdown, the first should change to what was selected in the second. My code in the event looks like this:

if(!ddl1.SelectedValue.Equals(ddl2.SelectedValue)
{
    ddl1.SelectedValue = ddl2.SelectedValue;
}

The OnSelectedIndexChanged event also contains code that rebinds the datagrid on the bottom of the page based on the selection of the second dropdownlist. Long story short, the datagrid changes, but the first dropdown does not change its value. It doesn’t seem like a postback should limit what would change on a page, so what am I missing here?

  • 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-06-09T12:19:39+00:00Added an answer on June 9, 2026 at 12:19 pm
    if(!ddl1.SelectedValue.Equals(ddl2.SelectedValue)
    {
         ddl1.ClearSelection();
         ddl1.Items.FindByValue(ddl2.SelectedValue).Selected = True
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple feedback form in a Kentico CMS site. There are two
Imagine you have a website with several drop-downs that are populated from the back-end
I have a form that I want to present in two states: 1) Normal
I have a simple form that lists user names and for each user, the
I have a mini form that consists of all select boxes and checkbox lists.
I have some code that builds a string array using data from a form:
My issue is that I have two dropdown boxes that I need to align.
I have a dropdown list that auto submits a form and performs a search
I have a snippet of HTML that is part of a form where there
I have two DropDownLists on my form. There's no item in neither one. In

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.