开发者

How to dynamically add value in combo box using c sharp?

开发者 https://www.devze.com 2023-03-06 00:36 出处:网络
开发者_如何学编程Hi I want to allow user to add new country names in combo box if his/her desired country is not listed in combo box. so next time this value should be add in combo box as well. I want
开发者_如何学编程

Hi I want to allow user to add new country names in combo box if his/her desired country is not listed in combo box. so next time this value should be add in combo box as well. I want to do this using c sharp. Kindly guide me.


Assuming you mean winforms:
These will only be available locally. On a Button-Click, save the data to one of these:

  • Textfile
  • XML-file
  • SQLCE Database

You should find more than enough tutorials with a your-favorite-search-engine-search like "c# save and read data to X"
When you read the data again, simply add it to your combobox using combobox.items.add("country"); oor use the DataSource-property.

Assuming you mean ASP.net:
Save them to your database.

0

精彩评论

暂无评论...
验证码 换一张
取 消