private void conditionList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (orderBindingSource.Count <= e.RowIndex) { return; } OrderCondition obj = orderBindingSource[e.RowIndex] as OrderCondition; e.FormattingApplied = true; switch (e.ColumnIndex) { case 0: e.Value = obj.ToString(); break; case 1: e.Value = obj.IsConjunctionConnection ? "and" : "or"; break; default: e.FormattingApplied = false; break; } }
/// <summary> /// Represents the position. /// </summary> public override string ToString() { string orderd = ""; string NL = Environment.NewLine; orderd += "Number " + (ordNumb + 1).ToString() + NL; orderd += "Direction " + ordDir.ToString() + NL; orderd += "Type " + ordType.ToString() + NL; orderd += "Condition " + ordCond.ToString() + NL; orderd += "Status " + ordStatus.ToString() + NL; orderd += "Sender " + ordSender.ToString() + NL; orderd += "Origin " + ordOrigin.ToString() + NL; orderd += "If order " + (ordIF + 1).ToString() + NL; orderd += "To pos " + (ordPos + 1).ToString() + NL; orderd += "Lots " + ordLots.ToString() + NL; orderd += "Price " + ordPrice.ToString() + NL; orderd += "Price2 " + ordPrice2.ToString() + NL; orderd += "Note " + ordNote.ToString() + NL; return(orderd); }