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
45
How to pass in parameter to ValueToDisplayTextConverter?
posted

I need to pass in an extra parameter (DataItem) into my ValueToDisplayTextConverter so each cell can display its value AND unit when not editing, but just value when editing.  (Example - show "90%" when not editing, but "90" when editing)  So the current value of the cell IS 90, so editing appears correctly.  The unit (which could be different for every record) is another field on that record.

 

 <igDP:UnboundField Name="ValueAndUnit" Label="Value">
    <igDP:Field.Settings>
        <igDP:FieldSettings CellMinWidth="80" CellWidth="80" EditorType="{x:Type igEditors:XamNumericEditor}">
            <igDP:FieldSettings.EditorStyle>
                <Style TargetType="{x:Type igEditors:XamNumericEditor}" >
                    <Setter Property="ValueToDisplayTextConverter" Value="{StaticResource ParamValueConverter}"></Setter>
                    <Setter Property="PromptChar" Value=""></Setter>
                    <Setter Property="Mask" Value="{}{double:5.2}"></Setter>
                </Style>
            </igDP:FieldSettings.EditorStyle>
        </igDP:FieldSettings>
    </igDP:Field.Settings>
</igDP:UnboundField>
<igDP:Field Name="UnitOfMeasure" Visibility="Collapsed" />

 

If anybody could help, or point me towards something that would help I would appreciate it

Thanks