I have created a value converter that works fine for the xamNumericEditor. I need to send a parameter so that the converter does what I really need. I cannot use the standard Converter and ConverterParameter properties because I am not specifying fields as my xamDatagrid is bound to a dynamic DataTable object.
<Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value="{Binding ElementName=maskTextBox,Path=Text}"/> <Setter Property="ValueToDisplayTextConverter" Value="{StaticResource ExConverter}"/> <Setter Property="TrimFractionalZeros" Value="True"/> <Setter Property="Foreground" Value="White" /> <Setter Property="ValueType" Value="{x:Type sys:Double}"/> </Style>
Hello Ed,
Thank you for your post. I have been looking into the question that you are having and by default, the parameter of the ValueToTextConverter and the ValueToDisplayTextConverter, is the editor itself. What I can suggest is using the Tag property of the editor and use its value as parameter for the converter. Here is how you can implement this approach:
XAML:
<local:ExConverter x:Key="ExConverter"/>
<Style TargetType="{x:Type igWPF:XamNumericEditor}">
<Setter Property="ValueToDisplayTextConverter" Value="{StaticResource ExConverter}"/>
<Setter Property="Tag" Value="hide"/>
</Style>
C#:
public class ExConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
XamNumericEditor editor = parameter as XamNumericEditor;
if (editor.Tag == "hide")
// implement convertion based on parameter
}
if (value != null)
return value.ToString();
return value;
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I am just checking if you require any further assistance on the matter.