Set RowSpan with Converter

NikosGNikosG DEMember ✭✭

Hello guys,

I would like to have uneven rows in my ListView... what I do is to set the

HasUnevenRows="true"

and

<Label Grid.Row="0" Grid.RowSpan="{Binding Description, Converter={StaticResource ConverterHasValueToRowSpan}}" Text="asd"/>

and follows the converter:

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
        if (value == null)
        {
            return int.Parse("0");
        }

        return string.IsNullOrEmpty(value.ToString()) ? int.Parse("2") : int.Parse("0");
        }

I also tried without the integer parsing and I still get the error message:

Value was an invalid value for RowSpan. Parameter name: value

Can anyone help? It seems to me that I didn't forgot something.

Sign In or Register to comment.