How to Search Through a C# DropDownList Programmatically

后端 未结 9 1188
一生所求
一生所求 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:53

    The DropDownList inherits the Items collection from the ListControl. Since Items is an Array, you can use this syntax:

    dropdownlist1.Items.Contains(textbox1.Text) as a boolean.

提交回复
热议问题