private void dataGridViewAllOrders_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { if (e.ListChangedType == ListChangedType.ItemChanged) { return; } for (int rowIdx = 0; rowIdx < this.dataGridViewAllOrders.Rows.Count; rowIdx++) { DataGridViewCell orderLineItemIdCell = this.dataGridViewAllOrders.Rows[rowIdx].Cells[OrderDgv_OrderLineItemIndex]; if (orderLineItemIdCell.Value == null) { continue; } String orderLineItemId = orderLineItemIdCell.Value.ToString(); DataRow dr = getEbayTransactionLocally(orderLineItemId); if (dr == null) { continue; } String orderId = StringUtil.GetSafeString(this.dataGridViewAllOrders.Rows[rowIdx].Cells[OrderDgv_OrderIdIndex].Value); bool subtrans = false; if (orderId.IndexOf("-") < 0) { // An order with multiple transactions. bool imageSpecified = false; if (rowIdx > 0) { String prevOrderId = StringUtil.GetSafeString(this.dataGridViewAllOrders.Rows[rowIdx - 1].Cells[OrderDgv_OrderIdIndex].Value); if (prevOrderId == orderId) { this.dataGridViewAllOrders.Rows[rowIdx].Cells[OrderDgv_ImageIndex].Value = blankImage; //this.dataGridViewAllOrders.Rows[rowIdx].DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#DBADDA"); imageSpecified = true; subtrans = true; } } if (!imageSpecified) { this.dataGridViewAllOrders.Rows[rowIdx].Cells[OrderDgv_ImageIndex].Value = minusImage; } if (subtrans) { this.dataGridViewAllOrders.Rows[rowIdx].DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#DBADDA"); } //subtrans = true; } else { this.dataGridViewAllOrders.Rows[rowIdx].Cells[OrderDgv_ImageIndex].Value = normalImage; } //if (StringUtil.GetSafeBool(dr["IsSellerLeftFeedback"])) // this.dataGridViewAllOrders.Rows[rowIdx].Cells[OrderDgv_SellerLeftFeedbackIndex].Value = yesImage; bool isShipped = StringUtil.GetSafeBool(dr["IsShipped"]); bool isPaid = StringUtil.GetSafeBool(dr["IsPaid"]); // http://www.phpx.com/man/dhtmlcn/colors/colors.html if (isShipped == true && !subtrans) { this.dataGridViewAllOrders.Rows[rowIdx].DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#90EE90"); } if (isPaid == false && !subtrans) { this.dataGridViewAllOrders.Rows[rowIdx].DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#808080"); } } }