public override View GetView(int position, View convertView, ViewGroup parent) { if (convertView != null) { return(convertView); } else { var view = new CustomView(this.context); view.SetValue(viewModel.ContactsList[position]); return(view); } }
public Exporting() { this.SfGrid = new SfDataGrid(); this.SfGrid.AutoGeneratingColumn += GridAutoGenerateColumns; this.SfGrid.SelectionMode = SelectionMode.Single; this.SfGrid.ItemsSource = new ExportingViewModel().OrdersInfo; this.SfGrid.ShowRowHeader = false; this.SfGrid.HeaderRowHeight = 45; this.SfGrid.RowHeight = 45; exportPDfImage = new UIButton(); exportPDfImage.SetImage(UIImage.FromFile("Images/pdfexport.png"), UIControlState.Normal); exportPDfImage.TouchDown += ExportToPdf; exportPdf = new UIButton(UIButtonType.RoundedRect); exportPdf.SetTitleColor(UIColor.Black, UIControlState.Normal); exportPdf.SetTitle("Export To Pdf", UIControlState.Normal); exportPdf.Font = UIFont.SystemFontOfSize(11); exportPdf.TouchDown += ExportToPdf; exportExcelImage = new UIButton(); exportExcelImage.SetImage(UIImage.FromFile("Images/excelexport.png"), UIControlState.Normal); exportExcelImage.HorizontalAlignment = UIControlContentHorizontalAlignment.Center; exportExcelImage.TouchDown += ExportToExcel; exportExcel = new UIButton(UIButtonType.RoundedRect); exportExcel.Font = UIFont.SystemFontOfSize(11); exportExcel.SetTitle("Export To Excel", UIControlState.Normal); exportExcel.SetTitleColor(UIColor.Black, UIControlState.Normal); exportExcel.TouchDown += ExportToExcel; UIButton b = new UIButton(); b.Font = UIFont.SystemFontOfSize(5); excelView = new CustomView(); excelView.AddSubviews((exportExcelImage)); excelView.AddSubviews((exportExcel)); pdfView = new CustomView(); pdfView.AddSubviews(exportPDfImage); pdfView.AddSubviews(exportPdf); this.AddSubview(excelView); this.AddSubview(pdfView); this.AddSubview(this.SfGrid); }