Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Exception : value was invalid value for footer template

lyrc.csslyrc.css USMember
edited June 2015 in Xamarin.Forms

This exception appear when try to use a ViewCell in FooterTemplate

_productsListView = new ListView { ItemTemplate = new DataTemplate(() => new OffertedProductCell()), HasUnevenRows = true, BindingContext = _viewModel, FooterTemplate = new DataTemplate(() => new ListViewFooterCell()) };

`public class ListViewFooterCell : ViewCell
public ListViewFooterCell()
var descriptionLabel = new Label
TextColor = Color.White,
HorizontalOptions = LayoutOptions.EndAndExpand,
VerticalOptions = LayoutOptions.Center,
FontAttributes = FontAttributes.Bold,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
descriptionLabel.SetBinding(Label.TextProperty, "SummaryInfo");

        var layout = new StackLayout
            Orientation = StackOrientation.Horizontal,
            BackgroundColor = AppColors.MainColor,
            Children = { descriptionLabel }

        View = layout;

public string SummaryInfo { get { return string.Format("Cant. de Ofertas : {0:n0}", Products.Count); } }



  • lyrc.csslyrc.css USMember

    someone :(

  • adamkempadamkemp USInsider, Developer Group Leader mod

    The template for a header or footer should just be a View. Cell inherits directly from Element, not from View. Just change your base class from ViewCell to View.

Sign In or Register to comment.