예제 #1
0
        private async void ControlGrid_Load(object sender, EventArgs e)
        {
            if (DesignMode)
            {
                return;
            }
            gridView1.OptionsCustomization.AllowSort            = false;
            gridView1.OptionsCustomization.AllowFilter          = false;
            gridView1.OptionsView.ShowGroupPanel                = false;
            gridView1.OptionsBehavior.Editable                  = false;
            gridView1.OptionsView.ShowIndicator                 = false;
            gridView1.OptionsView.EnableAppearanceEvenRow       = true;
            gridView1.Appearance.EvenRow.BackColor              = Color.LightGray;
            gridView1.Columns["Image"].OptionsColumn.FixedWidth = true;
            gridView1.Columns["Image"].Width = 100;
            gridView1.RowHeight = 100;

            gridView1.CustomUnboundColumnData += gridView1_CustomUnboundColumnData;
            ProgressHud.Shared.Initialize(this, "");
            var dataSource = new StationDatasource();
            await dataSource.GetData();

            gridControl1.DataSource = dataSource.GetDataSource();
            ProgressHud.Shared.Stop();
        }
예제 #2
0
        public ControlFlights()
        {
            InitializeComponent();

            Load += async(sender, args) =>
            {
                if (DesignMode)
                {
                    return;
                }
                gridView1.OptionsCustomization.AllowSort   = false;
                gridView1.OptionsCustomization.AllowFilter = false;
                gridView1.OptionsView.ShowGroupPanel       = false;
                gridView1.OptionsBehavior.Editable         = false;
                gridView1.OptionsView.ShowIndicator        = false;

                var dataSource = new StationDatasource();
                await dataSource.GetData();

                lookUpEdit1.Properties.DisplayMember = "Name";
                lookUpEdit1.Properties.ValueMember   = "Id";
                lookUpEdit1.Properties.DataSource    = dataSource.GetDataSource();
                lookUpEdit1.Properties.PopulateColumns();
                for (var i = 0; i < lookUpEdit1.Properties.Columns.Count; i++)
                {
                    if (lookUpEdit1.Properties.Columns[i].FieldName != "Name" &&
                        lookUpEdit1.Properties.Columns[i].FieldName != "Id")
                    {
                        lookUpEdit1.Properties.Columns[i].Visible = false;
                    }
                }
                lookUpEdit1.ItemIndex = 0;


                lookUpEdit1.EditValueChanged += (o, eventArgs) =>
                {
                    if (!(o is LookUpEdit item))
                    {
                        return;
                    }
                    var currentList = (List <Station>)item.Properties.DataSource;
                    var stationItem = currentList[item.ItemIndex];

                    //Flüge laden!!!
                    //getFlightdata aus FirebaseLib
                    //Flüge an Grid binden.....
                };
                //gridControl1.DataSource = dataSource.GetDataSource();
            };
        }