我尝试将“选择选项”文本添加到ComboBox中的第0个索引,但它显示空白
public void BindDdlPartyAccount()
{
PartyAccount objDDlBind = new PartyAccount();
List<PartyAccount> ListDdlParty = new List<PartyAccount>();
ListDdlParty = objDDlBind.getDDlPartyDetails();
objDDlBind.selectOption = "Select Option";
objDDlBind.selectOptionId = 0;
ListDdlParty.Insert(objDDlBind.selectOptionId, objDDlBind);
ddlEditPartyAcc.DataSource = ListDdlParty;
ddlEditPartyAcc.ValueMember = "PAId";
ddlEditPartyAcc.DisplayMember = "name";
}
答案 0 :(得分:0)
您应该添加自定义对象类型
istDdlParty = objDDlBind.getDDlPartyDetails();
objDDlBind.name= "Select Option";