Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Add a "Please Select" option to a bound UltraComboEditor
posted

I am using Business Objects with NHibernate to poplulate an UltraComboEditor. The editor is set as a drop down and limited to the list.  I retrieve my List of objects and bind it to the Editor. I would like to provide the user a "Please Select" prompt as the first (Zero Index) of the drop down and am trying to determine the 'best' means to do this. I have attempted to do a UltraComboEditor.Items.Insert(0, New ValueListItem("Choose","Please Select") but recieve an error that the valuelist cannot be altered after bind.  I cannot 'add' it to my intitial list of objects before bind as this will cause error later on in trying to access a non-existant object.  Is there an option besides doing a loop through of my list to do an "Add" to the valuelist?

Here is my current code which is not working

Dim lstFS as IList(Of FieldSystem) = FieldSystemFactory.GetAll()

uceFieldSystem.ValueMember = "FieldSystemId"

uceFieldSystem.DisplayMember = "Name"

uceFieldSystem.DataSource = lstFS

uceFieldSystem.Items.Insert(0, New ValueListItem("Choose", "Please Select a Field System"))

My thanks in advance for help in determining the best means to accomplish this task.

Parents Reply Children