0

I have below model class my orders table

public class OrdersModel
    {
        public int id { get; set; }
        public int CustomerId { get; set; }
        public string Name { get; set; }
        public int NoOfClothes { get; set; }
        public int Price { get; set; }
        public int AdvancePayment { get; set; }
        public DateTime OrderDate { get; set; }
        public DateTime ReturnDate { get; set; }
        public int SuitQty { get; set; }
        public OrdersModel()
        {

        }

I populate grid which works good. I want to sum the AdvancePayment and Price columns either to show in text box or in the last row. Below is my code to populate grid.

 DataGridViewRow row = dataGridView1.CurrentRow;
            var CustomerId = int.Parse(row.Cells[0].Value.ToString());
            List<OrdersModel> Orders = GlobalConfig.Connections.GetAllCustomerOrders(CustomerId);
            
            ordersModelBindingSource.DataSource = Orders;

I search for it but I can't find the solution.

Hamayun Khan
  • 35
  • 1
  • 9

1 Answers1

2

Sorry, can't write comment's yet, but your question looks very similar to this one: https://stackoverflow.com/a/3779753/14569944

SKarpov
  • 131
  • 2