Windows Develop Bookmark and Share   
 index > Windows Forms Designer > DropDownList SelectedindexChanged event not firing
 

DropDownList SelectedindexChanged event not firing

i have 3 dropdownlists in one form .... on the first dropdownlist'sSelectedIndexChanged event the second dropdownlist is getting filled from the database and similarly the third dropdownlist is filled on second's SelectedIndexChanged event . Now in another form i am assigning values to those dropdownlists
dropdownlist1.SelectedItem="1101";
dropdownlist2.SelectedItem="abc";
dropdownlist3.SelectedItem="123-34";

when i tracedthe program i found out tat the dropdownlist1.SelectedItem="1101" is invokingits respective SelectedIndexChanged event whereas the other two r not invoking why is it so ???
harini_pavi  Monday, September 14, 2009 4:12 AM
SelectedIndexChanged will not fire if the item you are trying to select is already selected. If "abc" is the value selected automatically by just loading the list from the selection of the first DD control, then your second SelectedItem assignment will produce no change in the index of the second DD control, and therefore there is no SelectedIndexChanged event.

Without knowing much of your design or code, I'll suggest that a change in selection of dropdown i forces no selected item in dropdown i + 1 (where i in [1, 2]).
MCP
webJose  Monday, September 14, 2009 3:31 PM
SelectedIndexChanged will not fire if the item you are trying to select is already selected. If "abc" is the value selected automatically by just loading the list from the selection of the first DD control, then your second SelectedItem assignment will produce no change in the index of the second DD control, and therefore there is no SelectedIndexChanged event.

Without knowing much of your design or code, I'll suggest that a change in selection of dropdown i forces no selected item in dropdown i + 1 (where i in [1, 2]).
MCP
webJose  Monday, September 14, 2009 3:31 PM

You can use google to search for other answers

Custom Search

More Threads

• Custom ToolStripRenderer - Display at Design Time?
• listview back color when background image is set
• TypeConverter problem, please help!!!
• Persisting Design-Time Only Properties to .resx file
• control Properties
• Retrieving a combobox entry from a supplied index
• How can I update the dll with new versions in Visual Studio Designer?
• How do I retrieve current Project Name and Path for form currently open in the designer
• removing the focus rectangle from a flat button
• Disappearence of Windows Forms Designer