Another combobox question


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I am having trouble binding a combox that is populated "manually" just entering the values in the control's list. Population by BO and Enum is fine. Whenever I navigate, or change the combo value I get this....





Keith Chisarik
Attachments
manual.jpg (253 views, 95.00 KB)
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
It has to do with your binding value within your data source...it has a NULL value.  Obviously you have data bound to the control...but your problem is in your population of the combo.  For example, if I wanted to populate a combo manually, I generally create an ADO.NET data table and bind it to the data source:

Dim loTable As New DataTable()

loTable.Columns.Add(New DataColumn("Display",GetType(String)))
loTable.Columns.Add(New DataColumn("Value",GetType(Integer)))

'-- Populate the table with your values

'-- Set the combo data source
MyCombo.DisplayMember = "Display"
MyCombo.ValueMember = "Value"
MyCombo.DataSource = loTable

You can obviously adjust the columns to the types and names that you want.  One other thing will be how you bind. By default, a StrataFrame combo looks at the Selectedvalue property for binding.  You can also adjust this by setting the BindingProperty of the combo to meet your needs.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search