async void DataGrid_GridLongPressed(object sender, Syncfusion.SfDataGrid.XForms.GridLongPressedEventArgs e)
        {
            var igm = e.RowData as IncassiGridModel;

            busyIndicator.IsBusy = true;

            ScaPagHead dsp = null;

            try
            {
                dsp = await dbcon_.GetAsync <ScaPagHead>(igm.dsp_codice);
            }
            catch (Exception ex)
            {
                busyIndicator.IsBusy = false;
                await DisplayAlert("Attenzione!", ex.Message, "OK");

                return;
            }
            if (dsp == null)
            {
                busyIndicator.IsBusy = false;
                return;
            }
            await DisplayAlert("Attenzione", "Guardiamo il dettaglio della distinta", "OK");

            //var page = new DocumentiEdit(ref fat, ref nuova);
            //await Navigation.PushAsync(page);
            busyIndicator.IsBusy = false;
        }
        private void dataGrid_GridLongPressed(object sender, Syncfusion.SfDataGrid.XForms.GridLongPressedEventArgs e)
        {
            if (!isContextMenuDisplayed)
            {
                currentColumnName = dataGrid.Columns[e.RowColumnIndex.ColumnIndex].MappingName;

                selectedRow = e.RowColumnIndex.RowIndex;
                var point = dataGrid.RowColumnIndexToPoint(e.RowColumnIndex);
                // Display the ContextMenu when the SfDataGrid is long pressed
                relativeLayout.Children.Add(contextMenu, Constraint.Constant(point.X), Constraint.Constant(point.Y));
                isContextMenuDisplayed = true;
            }
            else
            {
                // Hides the context menu when SfDataGrid is long pressed when the context menu is already visible in screen
                relativeLayout.Children.Remove(contextMenu);
                isContextMenuDisplayed = false;
            }
        }
Example #3
0
        async void OnGridLongPressed(object sender, Syncfusion.SfDataGrid.XForms.GridLongPressedEventArgs e)
        {
            if (_on_edit)
            {
                return;
            }

            if (((IncassiInfo)e.RowData).sca_locked != 0)
            {
                await DisplayAlert("Attenzione!", "L scadenza è bloccata e non può essere incassata!", "OK");

                return;
            }
            if (((IncassiInfo)e.RowData).sca_incasso.TestIfZero(2))
            {
                ((IncassiInfo)e.RowData).sca_incasso = ((IncassiInfo)e.RowData).sca_importo;
            }
            else
            {
                ((IncassiInfo)e.RowData).sca_incasso = 0.0;
            }
        }
        async void DataGrid_GridLongPressed(object sender, Syncfusion.SfDataGrid.XForms.GridLongPressedEventArgs e)
        {
            var doc = e.RowData as Documents;

            busyIndicator.IsBusy = true;

            Fatture fat   = null;
            bool    nuova = false;

            try
            {
                string sql     = String.Format("SELECT * from FATTURE2 WHERE fat_tipo = {0} AND fat_n_doc = {1} LIMIT 1", doc.fat_tipo, doc.fat_n_doc);
                var    docList = await dbcon_.QueryAsync <Fatture>(sql);

                if (docList.Count > 0)
                {
                    fat = docList[0];
                }
            }
            catch (Exception ex)
            {
                busyIndicator.IsBusy = false;
                await DisplayAlert("Attenzione!", ex.Message, "OK");

                return;
            }
            if (fat == null)
            {
                busyIndicator.IsBusy = false;
                return;
            }
            var page = new DocumentiEdit(ref fat, ref nuova);
            await Navigation.PushAsync(page);

            busyIndicator.IsBusy = false;
        }