The regular Drop down list boxes in windows are pretty useless. The drop
down datawindow is a much better control as you can display a textual value and receive a
code from the control. For example you can show the full state name but receive the code
for the state.
I quite often found myself needing to use a DDLB but wanted to use the functionality of
the DDDW. So I wrote a new generic DDDW control for my framework.
Basically I created a simple two column external Datawindow with a code and a value. I
painted the datawindow to show only the value. Then I created a second Datawindow external
sourced with a single column in the result set. The column size must match the size of the
code in the first DW. Then I altered the column to be a DDDW style and hooked up the first
DW.
Then I created a userobject control and placed the DW on the control. In the constructor I
grab the child and insert a blank row, then insert a row into the parent.
I then have functions to load the DDDW with values and a get and set function.
You can also inherit this control into a set of components for frequently used DDDW's such
as state and include them in your class library. |