How to Search Through a C# DropDownList Programmatically

后端 未结 9 1192
一生所求
一生所求 2021-02-14 05:24

I am having a hard time figuring out how to code a series of \"if\" statements that search through different dropdownlists for a specific value entered in a textbox. I was able

9条回答
  •  遇见更好的自我
    2021-02-14 05:37

    One line of code- split for readablilty.

    this.DropDownList1.SelectedItem = this.DropDownList1.Items
         .SingleOrDefault(ddli => ddli.value == this.textbox1.value);
    

提交回复
热议问题