private void Cv_SortChanged(object sender, System.EventArgs e)
        {
            GroupDescription yearGroupDescription    = new GroupDescription("Year");
            GroupDescription quarterGroupDescription = new GroupDescription("Quarter");
            GroupDescription monthGroupDescription   = new GroupDescription("MonthName");

            GroupDescription[] groupDescriptions = new GroupDescription[] { yearGroupDescription, quarterGroupDescription, monthGroupDescription };
            cv.GroupAsync(groupDescriptions);
        }
        private async Task UpdateVideos()
        {
            var data = Customer.GetCustomerList(100);

            _dataCollection = new C1DataCollection <Customer>(data);
            await _dataCollection.GroupAsync(c => c.Country);

            grid.ItemsSource    = _dataCollection;
            grid.MinColumnWidth = 85;
        }
Example #3
0
        private async Task UpdateVideos()
        {
            try
            {
                // Load video collection
                _videos = new ObservableCollection <YouTubeVideo>((await YouTubeCollectionView.LoadVideosAsync("WinForms", "relevance", null, 50)).Item2);
                // wrap the loaded collection to DataCollection
                _collectionView = new C1DataCollection <YouTubeVideo>(_videos);
                // grouping by ChannelTitle
                // Note: grouping is async
                await _collectionView.GroupAsync(v => v.ChannelTitle);

                // fill FlexGrid with loaded data
                c1FlexGrid1.Rows.RemoveRange(1, c1FlexGrid1.Rows.Count - 1);
                PopulateItemsAndGroups(_collectionView as IDataCollection <object>);
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine(e.Message);
            }
        }
Example #4
0
        private async Task UpdateVideos()
        {
            try
            {
                listView1.Visible    = false;
                progressBar1.Visible = true;
                _videos         = new ObservableCollection <YouTubeVideo>((await YouTubeDataCollection.LoadVideosAsync("WinForms", "relevance", null, 50)).Item2);
                _dataCollection = new C1DataCollection <YouTubeVideo>(_videos);
                await _dataCollection.GroupAsync(v => v.ChannelTitle);

                listView1.SetItemsSource(_dataCollection, "Title", "Thumbnail");
                listView1.Visible = true;
            }
            catch
            {
                MessageBox.Show(AppResources.InternetConnectionError, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                progressBar1.Visible = false;
            }
        }
        private async Task UpdateVideos()
        {
            try
            {
                emptyListLabel.Visibility    = System.Windows.Visibility.Collapsed;
                activityIndicator.Visibility = System.Windows.Visibility.Visible;
                var _videos = new ObservableCollection <YouTubeVideo>((await YouTubeCollectionView.LoadVideosAsync("WPF", "relevance", null, 50)).Item2);
                _dataCollection = new C1DataCollection <YouTubeVideo>(_videos);
                await _dataCollection.GroupAsync(v => v.ChannelTitle);

                grid.ItemsSource = new C1CollectionView(_dataCollection);
            }
            catch
            {
                emptyListLabel.Text       = AppResources.InternetConnectionError;
                emptyListLabel.Visibility = System.Windows.Visibility.Visible;
            }
            finally
            {
                activityIndicator.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
        private async Task UpdateVideos()
        {
            try
            {
                message.IsVisible           = false;
                list.IsVisible              = false;
                activityIndicator.IsRunning = true;
                _videos         = new ObservableCollection <YouTubeVideo>((await YouTubeDataCollection.LoadVideosAsync("Xamarin Forms", "relevance", null, 50)).Item2);
                _dataCollection = new C1DataCollection <YouTubeVideo>(_videos);
                await _dataCollection.GroupAsync(v => v.ChannelTitle);

                list.ItemsSource = _dataCollection;
                list.IsVisible   = true;
            }
            catch
            {
                message.Text      = AppResources.InternetConnectionError;
                message.IsVisible = true;
            }
            finally
            {
                activityIndicator.IsRunning = false;
            }
        }
Example #7
0
        private async Task UpdateVideos()
        {
            var data = Customer.GetCustomerList(100);

            _dataCollection = new C1DataCollection <Customer>(data);
            await _dataCollection.GroupAsync(c => c.Country);

            using (Grid.Columns.DisableAnimations())
            {
                Grid.AutoGenerateColumns = false;
                Grid.Columns.Add(new GridColumn {
                    Binding = "Active", Width = new GridLength(75)
                });
                Grid.Columns.Add(new GridColumn {
                    Binding = "Name", Width = GridLength.Star
                });
                Grid.Columns.Add(new GridColumn {
                    Binding = "OrderTotal", Width = new GridLength(110), Format = "C", Aggregate = GridAggregate.Sum, HorizontalAlignment = UIControlContentHorizontalAlignment.Right, HeaderHorizontalAlignment = UIControlContentHorizontalAlignment.Right
                });
            }
            Grid.GroupHeaderFormat       = NSBundle.MainBundle.GetLocalizedString("{name}: {value} ({count} items)", "");
            Grid.ItemsSource             = _dataCollection;
            _dataCollection.SortChanged += OnSortChanged;
        }
        private async Task UpdateVideos()
        {
            var data = Customer.GetCustomerList(100);

            _dataCollection = new C1DataCollection <Customer>(data);
            await _dataCollection.GroupAsync(c => c.Country);

            Grid.AutoGenerateColumns = false;
            Grid.ShowOutlineBar      = true;
            Grid.IsReadOnly          = true;
            Grid.Columns.Add(new GridColumn {
                Binding = "Active", Width = new GridLength(TypedValue.ApplyDimension(ComplexUnitType.Dip, 60, Resources.DisplayMetrics))
            });
            Grid.Columns.Add(new GridColumn {
                Binding = "Name", Width = GridLength.Star
            });
            Grid.Columns.Add(new GridColumn {
                Binding = "OrderTotal", Width = new GridLength(TypedValue.ApplyDimension(ComplexUnitType.Dip, 110, Resources.DisplayMetrics)), Format = "C", Aggregate = GridAggregate.Sum, HorizontalAlignment = Android.Views.GravityFlags.Right, HeaderHorizontalAlignment = Android.Views.GravityFlags.Right
            });
            Grid.GroupHeaderFormat       = Resources.GetString(Resource.String.GroupHeaderFormat);
            Grid.ItemsSource             = _dataCollection;
            _dataCollection.SortChanged += OnSortChanged;
            UpdateSortButton();
        }