Windows Store:How to Add item in GridView

  1. Add a GridView control to a parent container using XAML code editor with name attribute.
<GridView x:Name="GridView1" >           


To assign a name to the grid view, set the x:Name attribute to a string value. To refer to a control in code, it must have a name. Otherwise, a name is not required.

2. Add items to the grid view by populating the Items collection or by binding the ItemsSource property to a data source.
<GridView x:Name="GridView1" > 
<x:String> name </x:String>
<x:String> City </x:String>          


Start Screen

Windows Store:How to Add item in GridView
Windows Store:How to Add item in GridView

Apply II method in code file

1. Create a List of String Items and bind with GridView control in main file constructor.

public MainPage()




List<String> itemcoll = new List<String>();



GridView1.ItemsSource = itemcoll;




Popular posts from this blog

difference between structure and union in C Language

Difference between Linear search and Binary Search in c language

Difference between static and dynamic websites