public void AddNewItemCellAllItemsDataGridView(List <FullRgItem> itemsToAddList) { var firstItem = itemsToAddList.First(); var name = firstItem.Description.Name; var count = itemsToAddList.Sum(item => int.Parse(item.Asset.Amount)); var type = SteamItemsUtils.GetClearType(itemsToAddList.First()); var hiddenModel = new AllItemsHiddenCellModel { HashName = firstItem.Description.MarketHashName, ItemsList = itemsToAddList }; this.CreateNewCell(name, count, type, hiddenModel); }
private void CreateNewCell(string name, long count, string type, AllItemsHiddenCellModel hiddenCellModel) { var currentRowNumber = this.dataGrid.Rows.Add(); var nameCell = this.GetGridNameTextBoxCell(currentRowNumber); var countCell = this.GetGridCountTextBoxCell(currentRowNumber); var typeCell = this.GetGridTypeTextBoxCell(currentRowNumber); var comboBoxCell = this.GetGridCountToAddComboBoxCell(currentRowNumber); var hiddenCell = this.GetGridHiddenItemsListCell(currentRowNumber); nameCell.ChangeCellValue(name); countCell.ChangeCellValue(count); typeCell.ChangeCellValue(type); hiddenCell.ChangeCellValue(hiddenCellModel); SetDefaultAmountToAddComboBoxCellValue(comboBoxCell); }