Filling a .NET dropdown with static code table entries

In a previous post (Filling a .NET dropdown with code table entries) I described how it was possible to fill a .NET dropdown with dynamic code table entries such as title or address types, etc. When I tried to do the same thing with static table entries (e.g. gift types, payment types, etc) it proved a lot harder and a lot less intuitive.

Of course these are static values so it is quite easy to hard code them as they are unlikely to change but the point is when they do change we don’t want to have to revisit the code.

My initial thought was to use the what appeared to be the equivalent method for static code tables.  The StaticGetItemDataArray appears to be a similar method. In this method we only supply the table name in the form of an EStaticTableNumbers constant. However when you try this you just get an array with some other constant out and not the actual text value.

After a conversation with Blackbaud support I was told that there was another step involved. Using the constant from StaticGetItemDataArray, you need to feed this into another method; StaticTableTranslation. You then get the text value out.

This all seems somewhat convoluted and you could question why Blackbaud chose to do it this way and not follow the same pattern as for the dynamic code tables but it does work.