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
765
convert values from source-unit to target-unit
posted

Hello,
I have several columns in the wingrid with numeric values.
In the column caption is the unit from the values.

For example:

 x[m]    y[mm]
 
2,145    0,649
0,245    7,442


Now I will convert the values from column y from the unit mm to cm (value / 10).
The new value with the unit cm should be in the same cell(0,649 > 0,0649). 

How can I solve this problem?
Is there a solution with the wingrid (set the units (source-unit: mm, target-unit: cm) and call a command for this column)?

 

Alexander

  • 469350
    Offline posted

    Hi,

    There are a couple of ways you can do this, but what approach you take will depend a lot on whether or not the cell is editable.

    Do you need the users to be able to edit this cell?

    If so, then I would create a UserControl and embed it in the grid cell using the UltraControlContainerEditor.

    If not, then it would be much easier to use either an unbound column or else use a CreationFilter to translate the real value into the text you want the user to see.