c# - How can I select the year in each row -
i trying list of dates of year of manufacture determining age of vehicles. column looks this:
and code looks this
partial void reports_initializedataworkspace(list<idataservice> savechangesto) { // year of manufacture var yom = insurancequotations.selecteditem.myear; var bday = convert.todatetime(yom); datetime today = datetime.today; int age = today.year - bday.year; if (bday > today.addyears(-age)) age--; age = convert.tostring(age); }
i can select fist date in column. how loop through dates in column?
you can loop through insurance quotes:
foreach (insuarancequote item in insurancequotes) { var yom = item.myear; .... }
note: i'm making presumptions here. 1 grid of insurance quotes of type insurancequote
, 2 data collection on screen called insurancequotes
.
Comments
Post a Comment