數據存在於lstListSource
中,但不具有約束力。數據未在列表框中綁定
objLogEntries.Message.AppendLine("Bind ListBox with list started...");
listBoxControl.DataSource = lstListSource;
listBoxControl.DataTextField = strDataTextField;
listBoxControl.DataValueField = strDateValueField;
listBoxControl.DataBind();
objLogEntries.Message.AppendLine("Bind ListBox with list ended...");
Log.WriteTraceLog(objLogEntries);
它拋出一個異常:lstlnkSRAlias'(ID of listbox) has a SelectedValue which is invalid because it does not exist in the list of items
DataValueField一個完整的例子必須設置爲一個存在於lstListSource中的值。這個例外是告訴我,DataValueField被設置爲一個值不是 – Amir
@Amir,我沒有得到......數據進入lstListSource –
什麼是'strDataTextField'和'strDateValueField'的賦值? – DevT