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

Time:01-28

I'm using Xamarin.Forms.Datagrid to display my data in grid format. I'm just wondering is there a way of editing specific cells in the 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;
        }
}

The above is just an example that I have.

Thanks for any help.

CodePudding user response:

let's say your DataGrid is bound to a List<Widget>

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