コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var data = Customer.GetCustomerList(100);

            Grid.AutoGeneratingColumn += (s, e) =>
            {
                if (e.Property.Name == "Id")
                {
                    e.Cancel = true;
                }
            };
            Grid.ItemsSource    = data;
            Grid.BeginningEdit += OnBeginningEdit;
            Grid.CellEditEnded += OnCellEditEnded;

            Grid.GridLinesVisibility        = GridLinesVisibility.None;
            Grid.HeadersGridLinesVisibility = GridLinesVisibility.None;
            Grid.HeadersVisibility          = GridHeadersVisibility.Column;
            Grid.BackgroundColor            = UIColor.White;
            Grid.RowBackgroundColor         = ColorEx.FromARGB(0xFF, 0xE2, 0xEF, 0xDB);
            Grid.RowTextColor = UIColor.Black;
            Grid.AlternatingRowBackgroundColor = UIColor.White;
            Grid.ColumnHeaderBackgroundColor   = ColorEx.FromARGB(0xFF, 0x70, 0xAD, 0x46);
            Grid.ColumnHeaderTextColor         = UIColor.White;
            Grid.ColumnHeaderFont         = UIFont.BoldSystemFontOfSize(UIFont.LabelFontSize);
            Grid.SelectionBackgroundColor = ColorEx.FromARGB(0xFF, 0x5A, 0x82, 0x3F);
            Grid.SelectionTextColor       = UIColor.White;
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Grid.HeadersVisibility             = GridHeadersVisibility.Column;
            Grid.RowBackgroundColor            = ColorEx.FromARGB(0xFF, 0xE5, 0xE6, 0xFA);
            Grid.RowTextColor                  = UIColor.Black;
            Grid.AlternatingRowBackgroundColor = UIColor.White;
            Grid.GridLinesVisibility           = GridLinesVisibility.Vertical;
            Grid.ColumnHeaderBackgroundColor   = ColorEx.FromARGB(0xFF, 0x77, 0x88, 0x98);
            Grid.ColumnHeaderTextColor         = UIColor.White;
            Grid.ColumnHeaderFont              = UIFont.BoldSystemFontOfSize(UIFont.LabelFontSize);
            Grid.SelectionBackgroundColor      = ColorEx.FromARGB(0xFF, 0xFA, 0xD1, 0x27);
            Grid.SelectionTextColor            = UIColor.Black;
            Grid.AutoGenerateColumns           = false;
            Grid.AllowResizing                 = GridAllowResizing.Columns;
            Grid.Columns.Add(new GridColumn {
                Binding = "FirstName", Width = GridLength.Star
            });
            Grid.Columns.Add(new GridColumn {
                Binding = "LastName", Width = GridLength.Star
            });
            Grid.Columns.Add(new GridColumn {
                Binding = "LastOrderDate", Width = GridLength.Star, Format = "d"
            });
            Grid.Columns.Add(new GridColumn {
                Binding = "OrderTotal", Width = GridLength.Star, Format = "N", HorizontalAlignment = UIControlContentHorizontalAlignment.Right
            });
            var data = Customer.GetCustomerList(100);

            Grid.ItemsSource = data;
        }
コード例 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.GettingStarted);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.EditConfirmationTitle);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            var dips_50 = TypedValue.ApplyDimension(ComplexUnitType.Dip, 50, Resources.DisplayMetrics);

            Grid = FindViewById <FlexGrid>(Resource.Id.Grid);
            Grid.GridLinesVisibility        = GridLinesVisibility.None;
            Grid.HeadersGridLinesVisibility = GridLinesVisibility.None;
            Grid.HeadersVisibility          = GridHeadersVisibility.Column;
            Grid.BackgroundColor            = Color.White;
            Grid.RowBackgroundColor         = ColorEx.FromARGB(0xFF, 0xE2, 0xEF, 0xDB);
            Grid.RowTextColor = Color.Black;
            Grid.AlternatingRowBackgroundColor = Color.White;
            Grid.ColumnHeaderBackgroundColor   = ColorEx.FromARGB(0xFF, 0x70, 0xAD, 0x46);
            Grid.ColumnHeaderTextColor         = Color.White;
            Grid.ColumnHeaderTypeface          = Typeface.Create("", TypefaceStyle.Bold);
            Grid.SelectionBackgroundColor      = ColorEx.FromARGB(0xFF, 0x5A, 0x82, 0x3F);
            Grid.SelectionTextColor            = Color.White;
            Grid.DefaultRowHeight = new GridLength(dips_50);
            Grid.ItemsSource      = Customer.GetCustomerList(100);
            Grid.BeginningEdit   += OnBeginningEdit;
            Grid.CellEditEnded   += OnCellEditEnded;
        }
コード例 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.GettingStarted);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.StarSizingTitle);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            var dips_50 = TypedValue.ApplyDimension(ComplexUnitType.Dip, 50, Resources.DisplayMetrics);

            var grid = FindViewById <FlexGrid>(Resource.Id.Grid);

            grid.HeadersVisibility             = GridHeadersVisibility.Column;
            grid.BackgroundColor               = Color.White;
            grid.RowBackgroundColor            = ColorEx.FromARGB(0xFF, 0xE5, 0xE6, 0xFA);
            grid.RowTextColor                  = Color.Black;
            grid.AlternatingRowBackgroundColor = Color.White;
            grid.GridLinesVisibility           = GridLinesVisibility.Vertical;
            grid.ColumnHeaderBackgroundColor   = ColorEx.FromARGB(0xFF, 0x77, 0x88, 0x98);
            grid.ColumnHeaderTextColor         = Color.White;
            grid.ColumnHeaderTypeface          = Typeface.Create("", TypefaceStyle.Bold);
            grid.SelectionBackgroundColor      = ColorEx.FromARGB(0xFF, 0xFA, 0xD1, 0x27);
            grid.SelectionTextColor            = Color.Black;
            grid.AutoGenerateColumns           = false;
            grid.AllowResizing                 = GridAllowResizing.Columns;
            grid.DefaultRowHeight              = new GridLength(dips_50);
            grid.Columns.Add(new GridColumn {
                Binding = "FirstName", Width = GridLength.Star
            });
            grid.Columns.Add(new GridColumn {
                Binding = "LastName", Width = GridLength.Star
            });
            grid.Columns.Add(new GridColumn {
                Binding = "LastOrderDate", Width = GridLength.Star, Format = "d"
            });
            grid.Columns.Add(new GridColumn {
                Binding = "OrderTotal", Width = GridLength.Star, Format = "N", HorizontalAlignment = Android.Views.GravityFlags.Right
            });
            var data = Customer.GetCustomerList(100);

            grid.ItemsSource = data;
        }