wsyeager
Centurion
I'm getting the following error when trying to set a datasource property to a listbox:
"Item collection can't be modified if the Datasource property is set".
I want to add a default item to the listbox after the data is loaded, but I get the above msg:
Here is my code:
cboCustomerID.DataSource = DsCustomerID1.tblCustomerID
cboCustomerID.ValueMember = DsCustomerID1.tblCustomerID.Columns("CUSTOMER_ID").ToString
cboCustomerID.DisplayMember = DsCustomerID1.tblCustomerID.Columns("CUSTOMER_ID").ToString
cboCustomerID.Items.Insert(0, "ALL")
Does anyone know how I can add a default item to the listbox?
"Item collection can't be modified if the Datasource property is set".
I want to add a default item to the listbox after the data is loaded, but I get the above msg:
Here is my code:
cboCustomerID.DataSource = DsCustomerID1.tblCustomerID
cboCustomerID.ValueMember = DsCustomerID1.tblCustomerID.Columns("CUSTOMER_ID").ToString
cboCustomerID.DisplayMember = DsCustomerID1.tblCustomerID.Columns("CUSTOMER_ID").ToString
cboCustomerID.Items.Insert(0, "ALL")
Does anyone know how I can add a default item to the listbox?