• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Coded Domain and ComboBoxes

XxPrOdiGyxX

Senior member
I have a geodatabase with fields set as coded domains. What i'm trying to do is to populate a combobox with the coded domain values from the database. I have no problem extracting the coded domain values but can not set the combobox to populate it with the data. I know I can create a class with the coded value and name and just use Add() on the Items property but I would like to bypass that all together. I tried using the ICodedValueDomain and IDomain objects provided by ArcGIS and tried to set it to the datasource of the combobox but this doesn't seem to work. Anyone have any ideas?
 
I'm not familiar with the objects in question that you're dealing with, but I'd bet that any objects that you want to bind to the DataSource property will have to implement IList, ITypedList, or IBindingList to work correctly. This is just a hunch, I suppose I could dig up reflector and look at the code for the combobox, but I'm lazy.
 
I'm not sure how you're getting your data and in what format, but you may be able to do a quick hack like create an ArrayList and call AddRange on it, then bind that, but if you're going that route, you might as well just add them to the Items collection anyway.
 
Back
Top