I'm trying to pass "Product" column value as a parameter to converter, as follows. I tried the following, it does not seem to work. (So, basically the value of "MappedName" field should be passed as a parameter.)
What am I missing here please?
xaml:
<converters1:NullTextConverter x:Key="nullTextConverter" />
<dxg:GridColumn FieldName="MappedName" Header="Product" Visible="True" FilterPopupMode="Excel" ShowInColumnChooser="True" Width="140"/>
<dxg:GridColumn Header="Value" FieldName="Value" Visible="True" ShowInColumnChooser="False" ReadOnly="false" Width="260">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<dxe:TextEdit HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5" Width="215" FontSize="12" Text="{Binding RowData.Row.InputValue,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" NullText="{Binding View.DataContext.NullText, Converter={StaticResource nullTextConverter}, ConverterParameter={Binding ElementName=MappedName}}" ShowNullText="True" >
Viewmodel.cs:
this.NullText = "test";
public String NullText
{
get { return _nullTextValue; }
set
{
_nullTextValue = value;
RaisePropertyChangedEvent();
}
}
NulltextConverter:
public class NullTextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (parameter != null)
{
return parameter.ToString();
}
return "";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return "";
}
}
Thanks.