Unexpected ComboBox behavior - Web vs Desktop
Posted: Tue Mar 03, 2009 5:21 pm
I'm having problems manually inserting an item into a combox after it is populated by my DataSource.
It works fine in Preview Mode, but when the report is viewed in Web Viewer, the inserted item does not show up.
The following code appears in the LoadForm Event
The Combo Box is databound.
My theory is that this event fires just before the table is populated. The reason I suggest this is that if I try to insert the item at any point other than 0, I get an index out-of-bands error.
If I remove the databinding and just add items to the collection, the above code works.
It works fine in Preview Mode, but when the report is viewed in Web Viewer, the inserted item does not show up.
The following code appears in the LoadForm Event
Code: Select all
ContractStatusTable.Connect();
lstStatus.Items.Insert(0, "All");
lstStatus.SelectedIndex = 0;
My theory is that this event fires just before the table is populated. The reason I suggest this is that if I try to insert the item at any point other than 0, I get an index out-of-bands error.
If I remove the databinding and just add items to the collection, the above code works.