Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Copy/Paste from/to grid with display values

    Hi,
    I need advice how handle the following use case:
    There is a ListGrid bounded to the DataSource which has foreign key fields defined. Those fields are editable inside the grid and are represented by ComboBoxItems. The displayField attribute and the optionDataSource is set, so display value is shown to the user. During editing user picks or enters business key value via keyboard.

    I have already modified showcase example (copy to Excel), that display values (business key values) instead of useless id values are exported to clipboard.

    I would like now to code the opposite action that is pasting back into grid. The problem I have here is that I can update values in grid's row via setEditValue(), but this works with id values only. I can not find the way to set display/business key values into the corresponding fields.
    Is the only option here query the appropriate optionDS with criteria build with business key value?
    ComboBoxItem has this built in, but I have no idea how to use it in this situation.
    Please help.
    MichalG

    #2
    Yes, if you have the display value only, the id value is simply not present in the browser at all (or at least, not guaranteed to be present), so you need to contact the server.

    It's simple to do so - just use DataSource.fetchData(), using the displayValue as part of the criteria.

    Comment


      #3
      Ok.
      Thanks.

      Comment

      Working...
      X