Esempio n. 1
0
        private void CustomStackLayoutRenderer_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var pointerPoint = e.GetCurrentPoint(this);

            point.Y = pointerPoint.Position.Y;
            point.X = pointerPoint.Position.X;
            var rowColumnIndex = SfDataGridHelpers.PointToCellRowColumnIndex(grid, point);
            var model          = (GridModel)grid.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("GridModel")).GetValue(grid);

            if (previousIndex == rowColumnIndex.RowIndex)
            {
                rowdata = SfDataGridHelpers.GetRowGenerator(grid).Items.FirstOrDefault(x => x.RowIndex == rowColumnIndex.RowIndex);
                if (rowdata != null)
                {
                    wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
                    wholeRowElement.BackgroundColor = Xamarin.Forms.Color.Red;
                }
            }
            else
            {
                rowdata = SfDataGridHelpers.GetRowGenerator(grid).Items.FirstOrDefault(x => x.RowIndex == previousIndex);
                if (rowdata != null)
                {
                    wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
                    wholeRowElement.BackgroundColor = Xamarin.Forms.Color.White;
                }
            }
            previousIndex = rowColumnIndex.RowIndex;
        }
Esempio n. 2
0
 void SfGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
 {
     if (SfDataGridHelpers.IsCaptionSummaryRow(this.sfGrid, e.RowIndex))
     {
         e.Height  = 40;
         e.Handled = true;
     }
 }
Esempio n. 3
0
 void SfGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
 {
     if (SfDataGridHelpers.IsCaptionSummaryRow(this.sfGrid, e.RowIndex))
     {
         e.Height  = 30 * sfGrid.Resources.DisplayMetrics.Density;
         e.Handled = true;
     }
 }
Esempio n. 4
0
 private void DataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
 {
     if (e.RowIndex > 0)
     {
         e.Height  = SfDataGridHelpers.GetRowHeight(dataGrid, e.RowIndex);
         e.Handled = true;
     }
 }
 void GridQueryRowHeight(object sender, QueryRowHeightEventArgs e)
 {
     if (e.RowIndex > 0)
     {
         double height = SfDataGridHelpers.GetRowHeight(SfGrid, e.RowIndex);
         e.Height  = height + 24;
         e.Handled = true;
     }
 }
Esempio n. 6
0
 void HandleQueryRowHeightEventHandler(object sender, QueryRowHeightEventArgs e)
 {
     if (e.RowIndex > 0)
     {
         double height = SfDataGridHelpers.GetRowHeight(sfGrid, e.RowIndex);
         e.Height  = height + (16 * Resources.System.DisplayMetrics.Density);
         e.Handled = true;
     }
 }
Esempio n. 7
0
        void HandleQueryRowHeightEventHandler(object sender, QueryRowHeightEventArgs e)
        {
            double height = SfDataGridHelpers.GetRowHeight(sfGrid, e.RowIndex);

            if (height > 35)
            {
                e.Height  = height;
                e.Handled = true;
            }
        }
        /// <summary>
        /// Fired when a row comes in to View
        /// </summary>
        /// <param name="sender">DataGrid_QueryRowHeight sender</param>
        /// <param name="e">QueryRowHeightEventArgs parameter e</param>
        private void DataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
        {
            double height = SfDataGridHelpers.GetRowHeight(this.dataGrid, e.RowIndex);

            if (e.RowIndex > 0)
            {
                if (height > 35)
                {
                    e.Height  = height;
                    e.Handled = true;
                }
            }
        }
        /// <summary>
        /// Fired when a row comes in to View
        /// </summary>
        /// <param name="sender">DataGrid_QueryRowHeight sender</param>
        /// <param name="e">QueryRowHeightEventArgs parameter e</param>
        private void Datagrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
        {
            if (SfDataGridHelpers.IsCaptionSummaryRow(this.datagrid, e.RowIndex))
            {
                e.Height = 40;
                if (Device.Idiom == TargetIdiom.Tablet)
                {
                    e.Height = 50;
                }

                e.Handled = true;
            }
        }
Esempio n. 10
0
        void GridQueryRowHeight(object sender, QueryRowHeightEventArgs e)
        {
            double height = SfDataGridHelpers.GetRowHeight(SfGrid, e.RowIndex);

            if (height > 35)
            {
                e.Height  = height;
                e.Handled = true;
            }
            else if (e.RowIndex == 0)
            {
                e.Height  = 45;
                e.Handled = true;
            }
        }
Esempio n. 11
0
        private void DataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
        {
            double height = SfDataGridHelpers.GetRowHeight(dataGrid, e.RowIndex);

            if (e.RowIndex == 0)
            {
                e.Height  = 45;
                e.Handled = true;
            }
            else
            {
                if (height > 35)
                {
                    e.Height = height;
                }
                e.Handled = true;
            }
            //if (e.RowIndex > 0)
            //    e.Height = 100;
            //e.Handled = true;
        }
Esempio n. 12
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            sfDataPager                    = new SfDataPager(context);
            sfGrid                         = new SfDataGrid(context);
            sfGrid.SelectionMode           = SelectionMode.Single;
            viewModel                      = new PagingViewModel();
            sfDataPager.PageSize           = 15;
            sfDataPager.Source             = viewModel.OrdersInfo;
            sfDataPager.NumericButtonCount = 20;
            sfGrid.AutoGeneratingColumn   += GridGenerateColumns;
            sfGrid.ItemsSource             = sfDataPager.PagedSource;
            sfGrid.VerticalOverScrollMode  = VerticalOverScrollMode.None;

            LinearLayout linearLayout = new LinearLayout(context);

            linearLayout.Orientation = Orientation.Vertical;
            linearLayout.AddView(sfDataPager, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)SfDataGridHelpers.ConvertDpToPixels(this.sfGrid, 75)));
            linearLayout.AddView(sfGrid);

            return(linearLayout);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Button      exportPdf;
            Button      exportExcel;
            SfDataPager sfDataPager;

            intentKey = Intent.GetStringExtra(GetString(Resource.String.InformesIntentKey));
            LinearLayout linearLayout = new LinearLayout(this);

            linearLayout.Orientation = Orientation.Vertical;

            exportPdf      = new Button(this);
            exportPdf.Text = "Exportar PDF";
            exportPdf.SetMaxHeight(200);
            exportPdf.SetMaxWidth(100);
            exportPdf.Click += ExportToPdf;
            exportExcel      = new Button(this);
            exportExcel.Text = "Exportar Excel";
            exportExcel.SetMaxHeight(200);
            exportExcel.SetMaxWidth(100);
            exportExcel.Click += ExportToExcel;

            sfDataPager                    = new SfDataPager(this);
            sfGrid                         = new SfDataGrid(this);
            sfDataPager.PageSize           = 10;
            sfDataPager.NumericButtonCount = 20;

            switch (intentKey)
            {
            case "Informe Coordenadas":
                sfDataPager.Source = Perfil_Login.ListaCoordenadasEmpleado;
                break;

            default:
                sfDataPager.Source = Perfil_Login.ListaEmpleadosAsignados;
                break;
            }

            sfGrid.ItemsSource        = sfDataPager.PagedSource;
            sfGrid.SelectionMode      = SelectionMode.Single;
            sfGrid.AllowSorting       = true;
            sfGrid.SelectionChanging += sfGrid_SelectionChanging;

            LinearLayout option = new LinearLayout(this);

            option.SetGravity(GravityFlags.Center);
            option.Orientation = Orientation.Horizontal;
            option.AddView(exportPdf, Convert.ToInt32(150 * sfGrid.Resources.DisplayMetrics.Density), ViewGroup.LayoutParams.WrapContent);
            option.AddView(exportExcel, Convert.ToInt32(150 * sfGrid.Resources.DisplayMetrics.Density), ViewGroup.LayoutParams.WrapContent);
            LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
            layoutparams.SetMargins(0, (int)(20 * sfGrid.Resources.DisplayMetrics.Density), 0, (int)(20 * sfGrid.Resources.DisplayMetrics.Density));
            layoutparams.Gravity    = GravityFlags.CenterHorizontal;
            option.LayoutParameters = layoutparams;

            linearLayout.AddView(sfDataPager, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)SfDataGridHelpers.ConvertDpToPixels(sfGrid, 75)));
            linearLayout.AddView(option);
            linearLayout.AddView(sfGrid);
            SetContentView(linearLayout);
        }