public void UpdateMyOrdersHistory_UIResultHandler(RequestItemGroup resultResponse) { if (Helper.IsResultHasErrors(resultResponse)) { return; } List <OrderDone> ordersHistory = (List <OrderDone>)resultResponse.items[0].result.resultData; var dataView = ordersHistory.Select(item => new { date = item.doneDate, orderType = item.orderType, price = Helper.PriceToStringBtc(item.price), amount = Helper.TradeAmountToString(item.quantity), remain = item.quantityRemaining }).ToList(); List <DGVColumn> columns = new List <DGVColumn>() { new DGVColumn("date", "Date", "string"), new DGVColumn("orderType", "Type", "string"), new DGVColumn("price", "Price", "string"), new DGVColumn("amount", "Amount", "string"), new DGVColumn("remain", "Remain", "string") }; DataGridViewWrapper gv = new DataGridViewWrapper(dgridMyOrdersHistory, true); gv.Create(dataView, columns); gv.AutoSizeDisplayedExcept("remain"); }
public void UpdateMyOpenOrders_UIResultHandler(RequestItemGroup resultResponse) { if (Helper.IsResultHasErrors(resultResponse)) { return; } List <OpenOrder> myOpenOrders = (List <OpenOrder>)resultResponse.items[0].result.resultData; var dataView = myOpenOrders.Select(item => new { date = item.openedDate, orderType = item.orderType, price = Helper.PriceToStringBtc(item.price), amount = Helper.PriceToStringBtc(item.quantity), remain = Helper.PriceToStringBtc(item.quantityRemaining) }).ToList(); List <DGVColumn> columns = new List <DGVColumn>() { new DGVColumn("date", "Date", "string"), new DGVColumn("orderType", "Type", "string"), new DGVColumn("price", "Price", "string"), new DGVColumn("amount", "Amount", "string"), new DGVColumn("remain", "Remain", "string") }; DataGridViewWrapper gv = new DataGridViewWrapper(dgridOpenOrders, true); gv.Create(dataView, columns); gv.AutoSizeDisplayedExcept("price"); gv.RowColorByCondition("orderType", "SELL LIMIT", Color.LightPink); }
public void CreateBalancesGridView(List <ExchangeBalance> balances) { var dataView = balances.Select(item => new { exchangeName = item.exchangeName, currency = item.currency, balance = Helper.PriceToStringBtc(item.balance), }).OrderBy(p => p.exchangeName).ThenBy(p => p.currency).ToList(); List <DGVColumn> columns = new List <DGVColumn>() { new DGVColumn("exchangeName", "Exchange", "string"), new DGVColumn("currency", "Currency", "string"), new DGVColumn("balance", "Balance", "string") }; DataGridViewWrapper gv = new DataGridViewWrapper(dgridBalance, true); gv.Create(dataView, columns); gv.AutoSizeDisplayedExcept("balance"); }