Jump to content

Grid Editor Enhancement using DB components.


tappatappa

Recommended Posts

With the current implementation of Grid Column Editors you can only edit the value of the field the column is showing. In my opinion this is a mayor limitation in two cases:

 

1) Lookup fields/calculated fields

 

Suppose you are showing a list of people, each row has a TYPE_ID integer column, that is a foreign key for a lookup table. You do not want to show the number, which is meaningless.

So in the grid you show the "translation" (as a calculated/lookup field, for instance), you edit the value using a DBLookupComboBox, but the actual value has to be inserted in the TYPE_ID (hidden) field

 

2) Formatted fields

 

(In the above scenario) each row has a TIMESTAMP WITH TIME ZONE column. This column would be shown in the grid using the default format (for instance dd/mm/yyyy hh:mm:ss tzh:tzm), which can be weird for a untrained user. Instead, what I'd love to do is to show a string column, containing a formatted string, pairing it with a DBDateTimePicker that edits the "real" timestamp.

 

Bottom line

If a grid column Editor is a DB control, let the DB control do the work.

  • Upvote 2
Link to comment
Share on other sites

×
×
  • Create New...