Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
Column formula based on a lookup field
posted

Hi all,

here is my scenario: an UltraWinGrid bound to a DataTable; I am trying to add an unbound column to show, for each row in the grid, the value of a lookup field, i.e. the value in a list indexed by one of the grid columns.

An example: given the following columns in the bound DataTable:

ID      Name     Other

and a list containing the following fields:

ObjectID      ObjectProperty1

my goal is to have the following columns in the grid:

ID   Name   Other   ObjectProperty1

where ID=ObjectID

using a formula for the last, unbound column.

Is it possible?

Thank you

Francesco

 

 

  • 25
    posted

    Hi franzdeco,

    i have the same problem with you, do you have solution for this problem?? can you explain to me??

    Thanks

    Oki

  • 469350
    Suggested Answer
    Offline posted

    Hi Francesco,

    I don't think a formula is the way to go here. In theory, you could do this with a formula, but you would have to somehow put your list into the CalcNetwork - perhaps by placing it into a second grid or some other control. And it really doesn't seem like that would be worthwhile - it would be a lot of work for no good reason.

    A far easier way to do this would be to simply use a ValueList in the grid. You could use an actual ValueList or an UltraDropDown and bind it to your list of ObjectId/ObjectProperty1 items and attach the list to the ID column in the grid, or.. if you really need to show both the ID and the ObjectProperty1 in two separate columns, you would use the InitializeRow event to populate the unbound column with the ID from the ID column and then let the ValueList translate it to an ObjectProperty1 for you.