i used xlab gridview control and my gridview doesn't return any data it shows blank...
here is the code
public class GridPhotos : ContentPage
{
public GridPhotos ()
{
BackgroundColor = Color.Yellow;
Title = "Photo Gallery";
Icon = "Leads.png";
Label header = new Label
{ MinimumWidthRequest=910,
WidthRequest=910,
Text = "Photo Gallery",
TextColor=Color.White,
Font = Font.SystemFontOfSize(30, FontAttributes.Bold),
BackgroundColor=Color.FromHex("68c769"),
HorizontalOptions = LayoutOptions.Center
};
//Create GridView.
GridView gridview = new GridView
{ BackgroundColor=Color.White,
RowSpacing=5,
Padding=5,
ColumnSpacing = 5,
ItemWidth =152,
ItemHeight = 200,
ItemsSource = PhotoGalleryDatasource.GetList(),
// Define template for displaying each item.
// (Argument of DataTemplate constructor is called for
// each item; it must return a Cell derivative.)
ItemTemplate = new DataTemplate(() =>
{
Label titleLabel = new Label(){
FontAttributes=FontAttributes.Bold,
FontSize=16,
TextColor=Color.Black
};
titleLabel.SetBinding(Label.TextProperty, "Title");
// Return an assembled ViewCell.
return new ViewCell
{
View = new StackLayout
{ Children =
{ //newsimage
titleLabel
}
}
};
})
};
this.Content = new StackLayout
{
HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Start,
Children =
{
header,
gridview
}
};
}
}
}