I've set up a dropdown menu that is populated with options from my database. The issue I'm facing is that when the form loads, the first option in the dropdown is automatically selected. I want to ensure that no option is selected by default. Is there a way to achieve this?
I've tried manipulating the dropdown in the form's load event and/or the Page1.AfterLoad event:
Code: Select all
csharp
var dropdown = myForm.Controls["myDropdown"] as ComboBox;
dropdown.SelectedIndex = -1; // Attempt to set no selection
Code: Select all
csharp
var dropdown = myForm.Controls["myDropdown"] as ComboBox;
dropdown.Text = ""; // Trying to clear the selection