Пример #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (sfGrid != null)
                {
                    sfGrid.Dispose();
                }

                viewmodel = null;
                sfGrid    = null;
            }
            base.Dispose(disposing);
        }
Пример #2
0
        public override View GetSampleContent(Context context)
        {
            sfGrid    = new SfDataGrid(context);
            viewmodel = new EditingViewModel();
            sfGrid.AutoGenerateColumns    = false;
            sfGrid.RowHeight              = 50;
            sfGrid.AllowEditing           = true;
            sfGrid.EditTapAction          = TapAction.OnTap;
            sfGrid.ColumnSizer            = ColumnSizer.Star;
            sfGrid.SelectionMode          = SelectionMode.Single;
            sfGrid.NavigationMode         = NavigationMode.Cell;
            sfGrid.HeaderRowHeight        = 40;
            sfGrid.ItemsSource            = viewmodel.DealerInformation;
            sfGrid.VerticalOverScrollMode = VerticalOverScrollMode.None;

            GridNumericColumn productPrice = new GridNumericColumn();

            productPrice.MappingName         = "ProductPrice";
            productPrice.HeaderText          = "Product Price";
            productPrice.HeaderTextAlignment = GravityFlags.Center;

            GridDateTimeColumn shippedDate = new GridDateTimeColumn();

            shippedDate.MappingName         = "ShippedDate";
            shippedDate.HeaderText          = "Shipped Date";
            shippedDate.HeaderTextAlignment = GravityFlags.Center;
            shippedDate.Format = "d";

            GridPickerColumn dealerName = new GridPickerColumn();

            dealerName.MappingName         = "DealerName";
            dealerName.HeaderText          = "Dealer Name";
            dealerName.ItemsSource         = viewmodel.CustomerNames;
            dealerName.HeaderTextAlignment = GravityFlags.Center;

            GridTextColumn productNo = new GridTextColumn();

            productNo.MappingName         = "ProductNo";
            productNo.HeaderText          = "Product No";
            productNo.HeaderTextAlignment = GravityFlags.Center;

            sfGrid.Columns.Add(productNo);
            sfGrid.Columns.Add(dealerName);
            sfGrid.Columns.Add(shippedDate);
            sfGrid.Columns.Add(productPrice);

            return(sfGrid);
        }
Пример #3
0
        public Editing()
        {
            sfGrid    = new SfDataGrid();
            viewmodel = new EditingViewModel();
            sfGrid.AutoGenerateColumns = false;
            sfGrid.RowHeight           = 50;
            sfGrid.AllowEditing        = true;
            sfGrid.SelectionMode       = SelectionMode.Single;
            sfGrid.NavigationMode      = NavigationMode.Cell;
            sfGrid.EditTapAction       = TapAction.OnTap;
            sfGrid.ColumnSizer         = ColumnSizer.Star;
            sfGrid.HeaderRowHeight     = 40;
            sfGrid.ItemsSource         = viewmodel.DealerInformation;

            GridNumericColumn productPrice = new GridNumericColumn();

            productPrice.MappingName         = "ProductPrice";
            productPrice.HeaderText          = "Product Price";
            productPrice.HeaderTextAlignment = UIKit.UITextAlignment.Center;

            GridDateTimeColumn shippedDate = new GridDateTimeColumn();

            shippedDate.MappingName         = "ShippedDate";
            shippedDate.HeaderText          = "Shipped Date";
            shippedDate.Format              = "d";
            shippedDate.HeaderTextAlignment = UIKit.UITextAlignment.Center;

            GridPickerColumn dealerName = new GridPickerColumn();

            dealerName.MappingName         = "DealerName";
            dealerName.HeaderText          = "Dealer Name";
            dealerName.ItemsSource         = viewmodel.CustomerNames;
            dealerName.HeaderTextAlignment = UIKit.UITextAlignment.Center;

            GridTextColumn productNo = new GridTextColumn();

            productNo.MappingName         = "ProductNo";
            productNo.HeaderText          = "Product No";
            productNo.HeaderTextAlignment = UIKit.UITextAlignment.Center;

            sfGrid.Columns.Add(productNo);
            sfGrid.Columns.Add(dealerName);
            sfGrid.Columns.Add(shippedDate);
            sfGrid.Columns.Add(productPrice);
            this.AddSubview(sfGrid);
        }