- Add a GridView control to a parent container using XAML code editor with name attribute.
</GridView>
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.
<x:String> name </x:String>
<x:String> City </x:String>
</GridView>
Start Screen
Apply II method in code file
1. Create a List of String Items and bind with GridView control in main file constructor.
public MainPage()
{
this.InitializeComponent();
List<String> itemcoll = newList<String>();
itemcoll.Add("Apple");
itemcoll.Add("Mango");
GridView1.ItemsSource = itemcoll;
}
Tidak ada komentar:
Posting Komentar