public override void Destroy()
 {
     sfGrid.AutoGeneratingColumn -= GridAutoGenerateColumns;
     sfGrid.Dispose();
     sfGrid    = null;
     viewModel = null;
 }
 public override void Destroy()
 {
     sfGrid.AutoGeneratingColumn -= GridAutoGenerateColumns;
     sfGrid.Dispose();
     sfGrid = null;
     viewModel = null;
 }
 public override View GetSampleContent(Context context)
 {
     sfGrid = new SfDataGrid (context);
     viewModel = new SalesInfoViewModel ();
     sfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
     sfGrid.ItemsSource = viewModel.DailySalesDetails;
     sfGrid.AllowSorting = true;
     sfGrid.SortComparers.Add(new SortComparer() { Comparer = new CustomSortComparer(), PropertyName = "Total" });
     sfGrid.GroupColumnDescriptions.Add (new GroupColumnDescription () { ColumnName = "Total", Converter = new GroupDataTimeConverter() });
     return sfGrid;
 }
示例#4
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (sfGrid != null)
         {
             sfGrid.AutoGeneratingColumn -= GridAutoGenerateColumns;
             sfGrid.Dispose();
             sfGrid = null;
         }
         viewModel = null;
     }
     base.Dispose(disposing);
 }
 public CustomGrouping ()
 {
     sfGrid = new SfDataGrid ();
     viewModel = new SalesInfoViewModel ();
     sfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
     sfGrid.ItemsSource = viewModel.DailySalesDetails;
     sfGrid.AllowSorting = true;
     this.sfGrid.HeaderRowHeight = 45;
     this.sfGrid.RowHeight = 45;
     sfGrid.SortComparers.Add (new SortComparer() { Comparer = new CustomSortComparer (), PropertyName = "Total" });
     sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription() { ColumnName = "Total", Converter = new GroupDataTimeConverter() });
     this.control = this;
     this.AddSubview (sfGrid);
 }
示例#6
0
 public override View GetSampleContent(Context context)
 {
     sfGrid    = new SfDataGrid(context);
     viewModel = new SalesInfoViewModel();
     sfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
     sfGrid.ItemsSource           = viewModel.DailySalesDetails;
     sfGrid.AllowSorting          = true;
     sfGrid.SortComparers.Add(new SortComparer()
     {
         Comparer = new CustomSortComparer(), PropertyName = "Total"
     });
     sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription()
     {
         ColumnName = "Total", Converter = new GroupDataTimeConverter()
     });
     return(sfGrid);
 }
 public CustomGrouping()
 {
     sfGrid    = new SfDataGrid();
     viewModel = new SalesInfoViewModel();
     sfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
     sfGrid.ItemsSource           = viewModel.DailySalesDetails;
     sfGrid.AllowSorting          = true;
     this.sfGrid.HeaderRowHeight  = 45;
     this.sfGrid.RowHeight        = 45;
     sfGrid.SortComparers.Add(new SortComparer()
     {
         Comparer = new CustomSortComparer(), PropertyName = "Total"
     });
     sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription()
     {
         ColumnName = "Total", Converter = new GroupDataTimeConverter()
     });
     this.control = this;
     this.AddSubview(sfGrid);
 }
示例#8
0
        public CustomGrouping()
        {
            sfGrid = new SfDataGrid();
            this.sfGrid.SelectionMode = SelectionMode.Single;
            viewModel = new SalesInfoViewModel();
            sfGrid.AutoGeneratingColumn         += GridAutoGenerateColumns;
            sfGrid.ItemsSource                   = viewModel.DailySalesDetails;
            sfGrid.AllowSorting                  = true;
            this.sfGrid.HeaderRowHeight          = 45;
            this.sfGrid.RowHeight                = 45;
            this.sfGrid.AllowGroupExpandCollapse = true;
            sfGrid.SortComparers.Add(new SortComparer()
            {
                Comparer = new CustomSortComparer(), PropertyName = "Total"
            });
            sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription()
            {
                ColumnName = "Total", Converter = new GroupDataTimeConverter()
            });

            //TableSummary codes
            GridTableSummaryRow summaryRow = new GridTableSummaryRow();

            summaryRow.Title            = "Total items:{Total} items";
            summaryRow.ShowSummaryInRow = true;
            summaryRow.Position         = Position.Bottom;
            GridSummaryColumn summaryColumn = new GridSummaryColumn();

            summaryColumn.Name        = "Total";
            summaryColumn.MappingName = "Name";
            summaryColumn.Format      = "{Count}";
            summaryColumn.SummaryType = Syncfusion.Data.SummaryType.CountAggregate;
            summaryRow.SummaryColumns.Add(summaryColumn);
            sfGrid.TableSummaryRows.Add(summaryRow);

            this.AddSubview(sfGrid);
        }
        public override View GetSampleContent(Context context)
        {
            sfGrid                          = new SfDataGrid(context);
            viewModel                       = new SalesInfoViewModel();
            sfGrid.SelectionMode            = SelectionMode.Single;
            sfGrid.AutoGeneratingColumn    += GridAutoGenerateColumns;
            sfGrid.ItemsSource              = viewModel.DailySalesDetails;
            sfGrid.AllowSorting             = true;
            sfGrid.AllowGroupExpandCollapse = true;
            sfGrid.VerticalOverScrollMode   = VerticalOverScrollMode.None;
            sfGrid.SortComparers.Add(new SortComparer()
            {
                Comparer = new CustomSortComparer(), PropertyName = "Total"
            });
            sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription()
            {
                ColumnName = "Total", Converter = new GroupDataTimeConverter()
            });

            //TableSummary codes
            GridTableSummaryRow summaryRow = new GridTableSummaryRow();

            summaryRow.Title            = "Total items:{Total} items";
            summaryRow.ShowSummaryInRow = true;
            summaryRow.Position         = Position.Bottom;
            GridSummaryColumn summaryColumn = new GridSummaryColumn();

            summaryColumn.Name        = "Total";
            summaryColumn.MappingName = "Name";
            summaryColumn.Format      = "{Count}";
            summaryColumn.SummaryType = Syncfusion.Data.SummaryType.CountAggregate;
            summaryRow.SummaryColumns.Add(summaryColumn);
            sfGrid.TableSummaryRows.Add(summaryRow);

            return(sfGrid);
        }
示例#10
0
 public override void Destroy()
 {
     sfGrid.Dispose();
     sfGrid    = null;
     viewModel = null;
 }
示例#11
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            LinearLayout linear = new LinearLayout(context);

            linear.Orientation            = Android.Widget.Orientation.Vertical;
            sfGrid                        = new SfDataGrid(context);
            sfGrid.VerticalOverScrollMode = VerticalOverScrollMode.None;
            sfGrid.SelectionMode          = SelectionMode.Multiple;
            viewModel                     = new SalesInfoViewModel();
            sfGrid.AutoGenerateColumns    = false;
            sfGrid.ItemsSource            = viewModel.DailySalesDetails;
            sfGrid.AllowResizingColumn    = true;
            sfGrid.VerticalOverScrollMode = VerticalOverScrollMode.None;
            sfGrid.CellRenderers.Remove("Unbound");
            sfGrid.CellRenderers.Add("Unbound", new UnboundColumnRenderer());
            sfGrid.Alpha         = 0.87f;
            sfGrid.SelectedIndex = 3;
            sfGrid.GridStyle     = new UnboundRowstyle();
            sfGrid.ColumnSizer   = ColumnSizer.Star;
            sfGrid.UnboundRows.Add(new GridUnboundRow()
            {
                Position = UnboundRowsPosition.FixedBottom
            });
            sfGrid.QueryUnboundRow  += SfGrid_QueryUnboundRow;
            sfGrid.QueryRowHeight   += SfGrid_QueryRowHeight;
            sfGrid.SelectionChanged += SfGrid_SelectionChanged;

            if (MainActivity.IsTablet)
            {
                this.sfGrid.UnboundRows.Insert(0, new GridUnboundRow()
                {
                    Position = UnboundRowsPosition.FixedTop
                });
                this.sfGrid.UnboundRows.Insert(0, new GridUnboundRow()
                {
                    Position = UnboundRowsPosition.Top
                });
            }

            GridTextColumn EmployeeName = new GridTextColumn();

            EmployeeName.HeaderText          = "Employee";
            EmployeeName.TextAlignment       = GravityFlags.CenterVertical | GravityFlags.Left;
            EmployeeName.HeaderTextAlignment = GravityFlags.CenterVertical | GravityFlags.Left;
            EmployeeName.HeaderCellTextSize  = 12;
            EmployeeName.MappingName         = "Name";
            EmployeeName.LoadUIView          = true;
            sfGrid.Columns.Add(EmployeeName);

            GridTextColumn QS1 = new GridTextColumn();

            QS1.LoadUIView          = true;
            QS1.HeaderText          = "2015";
            QS1.Format              = "C";
            QS1.LineBreakMode       = LineBreakMode.NoWrap;
            QS1.HeaderTextAlignment = GravityFlags.CenterVertical | GravityFlags.Left;
            QS1.HeaderCellTextSize  = 12;
            QS1.TextAlignment       = GravityFlags.CenterVertical | GravityFlags.Right;
            QS1.MappingName         = "QS1";
            if (MainActivity.IsTablet)
            {
                sfGrid.Columns.Add(QS1);
            }

            GridTextColumn QS2 = new GridTextColumn();

            QS2.LoadUIView          = true;
            QS2.HeaderText          = "2016";
            QS2.Format              = "C";
            QS2.LineBreakMode       = LineBreakMode.NoWrap;
            QS2.HeaderTextAlignment = GravityFlags.CenterVertical | GravityFlags.Left;
            QS2.HeaderCellTextSize  = 12;
            QS2.TextAlignment       = GravityFlags.CenterVertical | GravityFlags.Right;
            QS2.MappingName         = "QS2";
            sfGrid.Columns.Add(QS2);

            GridTextColumn QS3 = new GridTextColumn();

            QS3.LoadUIView          = true;
            QS3.HeaderText          = "2017";
            QS3.Format              = "C";
            QS3.LineBreakMode       = LineBreakMode.NoWrap;
            QS3.HeaderTextAlignment = GravityFlags.CenterVertical | GravityFlags.Left;
            QS3.HeaderCellTextSize  = 12;
            QS3.TextAlignment       = GravityFlags.CenterVertical | GravityFlags.Right;
            QS3.MappingName         = "QS3";
            sfGrid.Columns.Add(QS3);

            GridUnboundColumn Total = new GridUnboundColumn();

            Total.TextAlignment = GravityFlags.Right | GravityFlags.CenterVertical;
            if (MainActivity.IsTablet)
            {
                Total.Expression = "(QS1 + QS2 + QS3 )";
            }
            else
            {
                Total.Expression = "(QS2 + QS3)";
            }
            Total.Format              = "C";
            Total.LineBreakMode       = LineBreakMode.NoWrap;
            Total.HeaderText          = "Total";
            Total.HeaderTextAlignment = GravityFlags.Left | GravityFlags.CenterVertical;
            Total.HeaderCellTextSize  = 12;
            Total.HeaderFont          = Typeface.Create("Roboto-Regular", TypefaceStyle.Normal);
            Total.RecordFont          = Typeface.Create("Roboto-Regular", TypefaceStyle.Normal);
            Total.TextAlignment       = GravityFlags.Center;
            Total.MappingName         = "Total";
            Total.LoadUIView          = true;
            sfGrid.Columns.Add(Total);

            linear.AddView(sfGrid);
            return(linear);
        }
示例#12
0
        public UnboundColumn()
        {
            this.SfGrid                     = new SfDataGrid();
            this.viewModel                  = new SalesInfoViewModel();
            this.SfGrid.ColumnSizer         = ColumnSizer.Star;
            this.SfGrid.AutoGenerateColumns = false;
            this.SfGrid.ItemsSource         = viewModel.DailySalesDetails;
            this.SfGrid.HeaderRowHeight     = 45;
            this.SfGrid.RowHeight           = 45;
            this.SfGrid.SelectionMode       = SelectionMode.Multiple;
            this.SfGrid.SelectedIndex       = 3;
            this.SfGrid.AllowResizingColumn = true;
            this.SfGrid.GridStyle           = new UnboundRowStyle();
            SfGrid.CellRenderers.Remove("Unbound");
            SfGrid.CellRenderers.Add("Unbound", new UnboundColumnRenderer());
            SfGrid.UnboundRows.Add(new GridUnboundRow()
            {
                Position = UnboundRowsPosition.FixedBottom
            });
            SfGrid.QueryUnboundRow  += SfGrid_QueryUnboundRow;
            SfGrid.SelectionChanged += SfGrid_SelectionChanged;
            SfGrid.QueryRowHeight   += SfGrid_QueryRowHeight;

            GridTextColumn EmployeeName = new GridTextColumn();

            EmployeeName.HeaderText          = "Employee";
            EmployeeName.TextAlignment       = UITextAlignment.Left;
            EmployeeName.HeaderTextAlignment = UITextAlignment.Center;
            EmployeeName.HeaderCellTextSize  = 12;
            EmployeeName.MappingName         = "Name";
            SfGrid.Columns.Add(EmployeeName);

            GridTextColumn QS1 = new GridTextColumn();

            QS1.HeaderText          = "2015";
            QS1.Format              = "C";
            QS1.HeaderTextAlignment = UITextAlignment.Center;
            QS1.HeaderCellTextSize  = 12;
            QS1.TextAlignment       = UITextAlignment.Right;
            QS1.MappingName         = "QS1";
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                this.SfGrid.UnboundRows.Insert(0, new GridUnboundRow()
                {
                    Position = UnboundRowsPosition.FixedTop
                });
                this.SfGrid.UnboundRows.Insert(0, new GridUnboundRow()
                {
                    Position = UnboundRowsPosition.Top
                });
                SfGrid.Columns.Add(QS1);
            }

            GridTextColumn QS2 = new GridTextColumn();

            QS2.HeaderText          = "2016";
            QS2.Format              = "C";
            QS2.HeaderTextAlignment = UITextAlignment.Center;
            QS2.HeaderCellTextSize  = 12;
            QS2.TextAlignment       = UITextAlignment.Right;
            QS2.MappingName         = "QS2";
            SfGrid.Columns.Add(QS2);

            GridTextColumn QS3 = new GridTextColumn();

            QS3.HeaderText          = "2017";
            QS3.Format              = "C";
            QS3.HeaderTextAlignment = UITextAlignment.Center;
            QS3.HeaderCellTextSize  = 12;
            QS3.TextAlignment       = UITextAlignment.Right;
            QS3.MappingName         = "QS3";
            SfGrid.Columns.Add(QS3);

            GridUnboundColumn Total = new GridUnboundColumn();

            Total.TextAlignment = UITextAlignment.Center;
            if (UserInterfaceIdiomIsPhone)
            {
                Total.Expression = "(QS2 + QS3)";
            }
            else
            {
                Total.Expression = "(QS1 + QS2 + QS3 )";
            }
            Total.Format              = "C";
            Total.HeaderText          = "Total";
            Total.HeaderTextAlignment = UITextAlignment.Center;
            Total.HeaderCellTextSize  = 12;
            Total.TextAlignment       = UITextAlignment.Center;
            Total.MappingName         = "Total";
            SfGrid.Columns.Add(Total);

            foreach (GridColumn column in SfGrid.Columns)
            {
                if (UserInterfaceIdiomIsPhone)
                {
                    SfGrid.ColumnSizer = ColumnSizer.None;
                }
                else
                {
                    SfGrid.ColumnSizer = ColumnSizer.Star;
                }
            }
            this.AddSubview(SfGrid);
        }