private async void PortButton_Clicked(object sender, EventArgs e) { try { IsEnabled = false; DataRow drPort = customizer.Lignes.Rows.FirstOrDefault(dr => dr["id_article"].ToString() == ID_PORT); decimal currentPort = drPort != null ? Convert.ToDecimal(drPort["pu"]) : 0; decimal? pu = await Dialogs.AskDecimal(customizer.Page, "Quel montant pour les frais de port ?", 2, currentPort); if (pu == null) return; if (drPort != null) customizer.Lignes.RemoveRow(drPort); drPort = customizer.Lignes.NewRow(); drPort["id_article"] = ID_PORT; drPort["designatio"] = DESIGN_PORT; drPort["q"] = 1; drPort["pu"] = pu.Value; customizer.Lignes.AddRow(drPort); } finally { IsEnabled = true; } }