internal void CreateGrid() { var model = new MainPageViewModel(); XFDataGridControl control = new XFDataGridControl(); control.ItemsSource = model.Itemsource; control.ColumnsSource = (List <XFGridColumn>)model.GridColumns; control.EnablePagination = true; control.ShowRecordPerPages = 12; }
public MainPage() { InitializeComponent(); var source = new emp[] { new emp { Name = "Smith", Age = 89 }, new emp { Name = "John", Age = 11 } }.ToList(); for (int k = 0; k < 43; k++) { var test = new[] { new emp { Name = "Smith", Age = 20 + k + 10 }, new emp { Name = "John", Age = 200 + k + 10 } }.ToList(); source.AddRange(test.ToList()); } var grid = new XFDataGridControl { ItemsSource = source, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; // grid.refres(); grid.OnItemEdit += Grid_OnItemEdit; stack.Children.Add(grid); }