public MainPageViewModel() { var src = new emp[] { new emp { name = "test", age = 38, id = "sam" + 1 } }.ToList(); for (int i = 2; i < 100; i++) { src.Add(new emp { name = "test " + i, age = i + 20, id = "sam" + i }); } Itemsource = src; GridColumns = new List <XFGridColumn>(); GridColumns.Add(new XFGridColumn { DisplayName = "ID", PropertyName = "id" }); GridColumns.Add(new XFGridColumn { DisplayName = "Name", PropertyName = "name" }); GridColumns.Add(new XFGridColumn { DisplayName = "Age", PropertyName = "age" }); }
private void XFDataGridControl_OnNeedDataSource(object sender, XFNeedDataSourceEventArgs args) { var src = new emp[] { new emp { name = "datasource", age = 38, id = "sam" + 1 } }.ToList(); for (int i = 2; i < 12; i++) { src.Add(new emp { name = "datasource " + i, age = i + 20, id = "sam" + i }); } args.ItemSource = src; }
private void Grid_OnPullToRefresh(object sender, XFPullToRefreshEventArgs args) { IList tt = new emp[] { new emp { name = "test", age = 89, id = "test" + 89 }, }.ToList(); for (int k = 0; k < 3; k++) { tt.Add(new emp { name = "newitem" + k, age = 20 + k + 10, id = "upee" + k }); } args.NewItems = tt; }