将项目(“---请选择---”)添加到带有数据源的组合框中

时间:2013-12-01 13:04:49

标签: c# winforms combobox datasource

我有一个包含数据源的组合框,但我想添加一个项目。

我希望它看起来像这样。

----Please select one---     //the item I want to add 
Tokyo                        //the items that came from the database
Osaka                        //the items that came from the database
Boston                       //the items that came from the database
Manila                       //the items that came from the database

我该如何解决这个问题?

谢谢

1 个答案:

答案 0 :(得分:-1)

Combobox1.DataSource = Yourdatasource; // this is your datasource
Combobox1.Items.Add("----Please select one---");