在组合框中添加一个空行 [英] add a empty row in the combobox
本文介绍了在组合框中添加一个空行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的组合框中添加一个空行。我该怎么做?
这是我的代码,
Hi , I want to add a empty row to my combobox.How can I do it?
This is my code,
protected void DataPortal_Fetch(SuperRegionInfoCriteria criteria)
{
SqlParameter[] parms = new SqlParameter[1];
parms[0] = new SqlParameter("@SuperRegionType_Short", criteria.Short);
DataTable dt = DataAccess.Query("Regions", "upSuperRegionType_Select_LU", parms);
this.RaiseListChangedEvents = false;
this.IsReadOnly = false;
var data = from row in dt.AsEnumerable()
select SuperRegionInfo.LoadDataObj(row);
this.AddRange(data);
this.IsReadOnly = true;
this.RaiseListChangedEvents = true;
推荐答案
comboBox.Items.Add()
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox(v = vs.110).aspx [ ^ ]
http://social.msdn.microsoft.com/Forums/windows / en-US / c7a82a6a-763e-424b-84e0-496caa9cfb4d / how-add-a-item-to-combobox?forum = winforms [ ^ ]
comboBox.Items.Add()
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox(v=vs.110).aspx[^]
http://social.msdn.microsoft.com/Forums/windows/en-US/c7a82a6a-763e-424b-84e0-496caa9cfb4d/how-add-a-item-to-combobox?forum=winforms[^]
这篇关于在组合框中添加一个空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文