Unexpected ComboBox behavior - Web vs Desktop

Stimulsoft Reports.WEB discussion
Post Reply
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

Unexpected ComboBox behavior - Web vs Desktop

Post by fuhrj »

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

Code: Select all

ContractStatusTable.Connect();

lstStatus.Items.Insert(0, "All");
lstStatus.SelectedIndex = 0;
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.

Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Unexpected ComboBox behavior - Web vs Desktop

Post by Edward »

Hi Fuhrj,

Please add all items 'by hand' from the ContractStatusTable data source after the Connect command:

Code: Select all

ContractStatusTable.Connect();
ContractStatusTable.DataTable.First();
while (!ContractStatusTable.DataTable.IsEof)
{
  lstStatus.Items.Add(ContractStatusTable.DataTable["MyColumn"].ToString());
  ContractStatusTable.DataTable.Next();
}
Thank you.
Post Reply