Clearing a drop down list in C#

前端 未结 2 695
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-08 01:05

I truly do hate to ask such a crayon-question... I\'m trying to clear, not remove a drop down combo list in VSC#. My ddl lets the user choose the payRate of an employee. I\'

相关标签:
2条回答
  • 2021-01-08 01:36

    try

    DropDownList1.Items.Clear(); 
    

    No hidden and clear the Drop Down List.

    0 讨论(0)
  • 2021-01-08 01:37

    you can do as below

    while(cmboPayRate.Items.Count>0)
       cmboPayRate.Items.RemoveAt(0);
    
    0 讨论(0)
提交回复
热议问题