private async void SfDataGrid_CurrentCellEndEdit(object sender, Syncfusion.SfDataGrid.XForms.GridCurrentCellEndEditEventArgs e)
        {
            var ItemObject = sender as Syncfusion.SfDataGrid.XForms.SfDataGrid;


            if (e.OldValue.ToString() != e.NewValue.ToString() && e.NewValue != null && ItemObject.CurrentItem != null)
            {
                sfGrid.IsBusy    = true;
                sfGrid.IsEnabled = false;
                var VATItem = ItemObject.CurrentItem as Models.VAT;
                if (e.RowColumnIndex.ColumnIndex == 0)
                {
                    VATItem.name = e.NewValue.ToString();
                }
                else if (e.RowColumnIndex.ColumnIndex == 1)
                {
                    VATItem.percentage = int.Parse(e.NewValue.ToString());
                }


                await viewModel.UpdateVat(VATItem);

                viewModel.Command.Execute(null);

                sfGrid.IsBusy    = false;
                sfGrid.IsEnabled = true;
            }
        }
示例#2
0
        async void OnCurrentCellEndEdit(object sender, Syncfusion.SfDataGrid.XForms.GridCurrentCellEndEditEventArgs e)
        {
            if (e.NewValue == null)
            {
                return;
            }

            double val = Convert.ToDouble(e.NewValue);
            var    rec = (IncassiInfo)dataGrid.GetRecordAtRowIndex(e.RowColumnIndex.RowIndex);

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

                return;
            }

            if (rec.sca_importo > 0.0)
            {
                if ((val < 0.0) || (val > rec.sca_importo))
                {
                    e.Cancel = true;
                }
            }
            else
            {
                if ((val > 0.0) || (Math.Abs(val) < Math.Abs(rec.sca_importo)))
                {
                    e.Cancel = true;
                }
            }
            _on_edit = false;
        }
        private async void sfgrid_CurrentCellEndEdit(object sender, Syncfusion.SfDataGrid.XForms.GridCurrentCellEndEditEventArgs e)
        {
            await Task.Delay(100);

            sfgrid.IsBusy = true;


            var newCellValue = sfgrid.GetCellValue(ViewModel.EditItems[e.RowColumnIndex.RowIndex - 1], sfgrid.Columns[e.RowColumnIndex.ColumnIndex].MappingName);
            var data         = sfgrid.GetRowGenerator().Items.FirstOrDefault(x => x.RowIndex == e.RowColumnIndex.RowIndex).RowData as Models.EditItem;
            var s            = data;

            //  await viewModel.UpdateTableAsync(s);

            sfgrid.UpdateDataRow(e.RowColumnIndex.RowIndex);
            sfgrid.Refresh();
            sfgrid.IsBusy = false;
        }
        private async Task sfgrid_CurrentCellEndEditAsync(object sender, Syncfusion.SfDataGrid.XForms.GridCurrentCellEndEditEventArgs e)
        {
            await Task.Delay(100);

            var newCellValue = sfgrid.GetCellValue(viewModel.Stolies[e.RowColumnIndex.RowIndex - 1], sfgrid.Columns[e.RowColumnIndex.ColumnIndex].MappingName);
        }