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
75
String[] column needs to be displayed on Infragisticsgrid
posted

HI,

I have a column by name Synonyms in my data model which is string[] type.

 public string[] Synonyms { get; set; }

Want to create a column name for Synonyms in the infragisctics grid.

 <converter:StringArrayToStringConverter x:Key="StringArrayToStringConverter"></converter:StringArrayToStringConverter>

<igDP:Field Name="Synonyms" AllowEdit="True" Label="{x:Static prop:Resources.MaintDraw_RecordGrid_Synonyms}" Visibility="Visible" Converter="{StaticResource StringArrayToStringConverter}" >
<igDP:Field.Settings>
<igDP:FieldSettings EditAsType="system:String"/>
</igDP:Field.Settings>
</igDP:Field>

public class StringArrayToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string convertString = string.Empty;
if(value is string[] cast)
{
foreach(var str in cast)
{
convertString = string.Concat(convertString, ", ", str);
}
}
return convertString;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

Unfortunately, i am not able to display that column? 

Can you quickly provide me the solution?