private void YearChoosen(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex >= 0 && e.RowIndex >= 0) { DataGridViewTextBoxCell cell = (DataGridViewTextBoxCell)yearList.Rows[e.RowIndex].Cells[e.ColumnIndex]; if (cell.Value != null) { //cell.Value; List <Kid> kids = mc.GetVisitByYear("" + cell.Value); List <GenericVisitor> generic = mc.GetGenericVisitByYear("" + cell.Value); int total = kids.Count; int jenterReg = GetGirlsFromVisit(kids); int gutterReg = GetBoysFromVisits(kids); int anonyme = GetAnonymFromGeneric(generic); int ukjent = GetUnknownFromGeneric(generic); int jente = GetGirlsFromGeneric(generic); int gutt = GetBoysFromGenericList(generic); yearRegistred.Text = "" + total; yearBoys.Text = "" + gutterReg; yearGirls.Text = "" + jenterReg; yearGutt.Text = "" + gutt; yearJente.Text = "" + jente; yearUkjent.Text = "" + ukjent; yearAnonym.Text = "" + anonyme; yearTotal.Text = "" + (total + generic.Count); CreateBoyGirlChart(jenterReg, gutterReg, yearChart1); CreateGenericChart(anonyme, ukjent, jente, gutt, yearChart2); CreateRegistredVSGenericChart(total, anonyme, ukjent, jente, gutt, yearChart3); } } }