RE-Decoded

A technical look at the Raiser's Edge API from Blackbaud


Feeds:

Filling a .NET dropdown with code table entries

September 23rd, 2008 by David Zeidman

One of the good things about the CCodeTablesServer class is the ability to fill a combo with code table entries. For example if I have a custom form and want to be able to allow the user to select say, a title, I can simply call the CCodeTablesServer class method LoadCombo and my combo is filled up with titles. Well it is if I am using a COM environment such as VB6. But what do I do if I am using .NET?

This is not as straight forward but there is a useful method nevertheless. Instead of loading the combo directly we can use the CodeTableGetDataArray method that returns a two dimensional array consisting of the codetable id and the description.

        Dim array2d As Object
        Dim shortValues As Boolean = False
        Dim activeOnly As Boolean = True
        Dim codetable As ECodeTableNumbers = ECodeTableNumbers.tbnumTitles

        array2d = getCodeTableServer.CodeTableGetDataArray(codetable, shortValues, activeOnly)

        For i As Integer = 1 To array2d.GetUpperBound(1)
            titlesDropDown.Items.Add(array2d(1, i))
        Next i

The getCodeTableServer method simply returns an initialised code table server object for brevity. The CodeTableGetDataArray method would, in the VB6 world return a Variant. Since these are not supported in .NET an Object is return instead. This is a 2d array. The first dimension consists of two elements; the id and the description. The second dimension is as big as the code table has values. In the above example we make use of the description only.

I had known about this method for a while but how do we get the values in the static code tables? These values include things like gift types, pay methods, etc. What this space…

Related posts:

  1. Filling a .NET dropdown with static code table entries In a previous post (Filling a .NET dropdown with code...
  2. Writing Code to populate the rejection code field in batch Sorry to get your hopes up but I am reliably...

Posted in Intermediate | 1 Comment »

One Response

  1. RE-Decoded » Blog Archive » Filling a .NET dropdown with static code table entries Says:

    [...] 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 [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.