void sboScan_UpdateLiveDataChange(List <MatchOddDTO> m, bool isLive, int type = 0) { LastColor = RandomColor(); string scanType = isLive ? "LIVE" : "Today"; foreach (var matchOdd in m) { var prepareBet = sboScan.PrepareBetAnyway(matchOdd, eBetType.Home, isLive); if (prepareBet != null && prepareBet.MaxBet <= maxStakeCompare) { dgvLogScan.Invoke( new MethodInvoker( delegate { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dgvLogScan, scanType, matchOdd.HomeTeamName, matchOdd.AwayTeamName, matchOdd.OddType, matchOdd.Odd, matchOdd.HomeOdd, matchOdd.AwayOdd, prepareBet.MaxBet); row.DefaultCellStyle.BackColor = LastColor; this.dgvLogScan.Rows.Insert(0, row); })); } } }