c# - How to loop through a DataGrid and get the column values with column header? -
Here is an example of how to obtain column based row values in an Observe Collection "Order Collection":
double order SUBTotal = (double) 0; Foreign Currency (Various Data in Order Order Collection) {Order Order Data = (Order) Data; //MessageBox.Show (orderData.Product.SalesPrice.ToString ()); OrderSwashot = OrderData Products. SellPrices; } This.OrderSum + = OrderSubTotal;
for (int i = 0; i & lt; datagrid Items calculation; i ++) {DataGridRow line = (DataGridRow) dataGrid.ItemContainerGenerator.ContainerFromIndex (i); (If the grid column. Header == "some") {// something}}
Comments
Post a Comment