有没有办法编辑 Xamarin.forms.datagrid 中的特定单元格?

Is there a way to edit spesific cells in Xamarin.forms.datagrid?

我正在使用 Xamarin.Forms.Datagrid 以网格格式显示我的数据。我只是想知道是否有一种方法可以编辑数据网格中的特定单元格?

foreach (DataGridViewRow OrderRow in dgvItemDetails.Rows)
{
    if (OrderRow.Cells[1].Value.ToString() == 
    DcoNumScanned.ToString() &&  OrderRow.Cells[2].Value.ToString() 
    == _ItemCode)
{
        OrderRow.Cells[4].Value = 
        (Convert.ToDouble(OrderRow.Cells[4].Value) - 
        Convert.ToDouble(_uomQty));
        break;
        }
}

以上只是我手头的一个例子

感谢您的帮助。

假设您的 DataGrid 绑定到 List<Widget>

foreach(var w in widgets)
{
   if (w.ID == DcoNumScanned.ToString() && w.Code == _ItemCode)
   {
      w.Price -= Convert.ToDouble(_uomQty));
      break;
   }
}