private void DTVLastItemsFillColumns() { string [,] columns = { { "id", "ID" }, { "name", "Nazwa" }, { "category", "Kategoria" }, { "date", "Dni temu" } }; DGVLastItems.AddColumns(columns); var query = queries.getGridViewLastItems(); foreach (var item in query.OrderByDescending(X => X.modify_date).Take(7)) { var calculatedDays = Utils.compareDateToNowAndGetDaysCount((DateTime)item.modify_date); DGVLastItems.Rows.Add(item.id, item.name, item.category, calculatedDays); } DGVLastItems.changeIdColumnVisableToFalse(); }