Document Actions

Configuring the editors

At the moment you can choose from a textbox, textarea or combo box ...

gareth

More detailed examples will be forthcoming, but for now ...
Page 1 of 1.

Note: I've not actually tested the text area - feedback would be good?

To use the editors, you need insert one string into the "Editors" property corresponding to each field you display. If you don't want to edit a field, use the keyword "auto".

  • To activate a text editor, use the keyword "text"
  • For a text area, use "area"
  • For a drop down / combo box use "combo"

Now we're left with the configuration of the drop-down combo boxes, this is easy for static drop downs and dynamic drop-downs really isn't all that hard either.

Static drop downs

Your editor string should read;

combo,<list>,<readonly>

for example;

combo,Apples,Pears,Oranges,Other,TRUE

Where <list> is a comma separated list of items and <readonly> is TRUE or FALSE.

If <readonly> is true, you will get the drop-down but not the opportunity to edit the text, if FALSE, you can use the drop down or enter raw text.

Dynamic drop downs

For those occasions where you want full control!

Set your field editor to "auto".

Now go to your main form and under "Form_Open" add a new procedure as follows;

PUBLIC SUB grid_Edit()
DIM Col as Integer = grid.Table.Column
SELECT Col
CASE <the column / field number we're interested in>
grid.ShowCombo([ <list> ], <readonly> )
END SELECT
END
Obviously you get to generate the list yourself, it might read for example;
      grid.ShowCombo([ "Apples","Oranges",Pears","Others" ], TRUE )
Now comes the fun bit where you want the drop-down to be dependent on another field in the grid;
'Assume we're editing field #4 and we're dependant on field #1

PUBLIC SUB grid_Edit()
DIM Row as Integer = grid.Table.Row
DIM Col as Integer = grid.Table.Column
SELECT Col
CASE 4
SELECT grid.getData(Row,1)
CASE "fruit"
grid.ShowCombo([ "Apples","Oranges",Pears","Others" ], TRUE )
CASE "vegetables"
grid.ShowCombo([ "Tomatoes","Beans",Potatoes","Others" ], TRUE )
END SELECT
END

Hopefully this give you the idea.