private void avgModeCheckboxChanged(object sender, EventArgs e) { if(AvgRadioButton.Checked) { AvgRadioButton.BackColor = Color.FromArgb(144, 195, 212); //avg urobit, ak neexistuje DataTable, vytvorit, inak iba prepnut. if (avgDataTable == null) { DbCommunication db = new DbCommunication(); avgDataTable = db.meranieAvg(header_id).Tables[0]; avgItems = new CheckedListBox.ObjectCollection(checkedListBoxInclude); foreach(DataColumn columnHeader in avgDataTable.Columns) { avgItems.Add(columnHeader.ToString()); } } dataMeranie.DataSource = avgDataTable; refreshIncludeColumns(avgItems); checkedListBoxCyklyInclude.Enabled = false; checkBoxCyklyAllInclude.Enabled = false; } else { AvgRadioButton.BackColor = default(Color); } }
private void init() { DbCommunication db = new DbCommunication(); normalDataTable = db.meranie(header_id).Tables[0]; dataMeranie.DataSource = normalDataTable; header = db.header(header_id); normalItems = new CheckedListBox.ObjectCollection(checkedListBoxInclude); for (int c = 0; c < dataMeranie.Columns.Count; c++) { dataMeranie.Columns[c].SortMode = DataGridViewColumnSortMode.NotSortable; dataMeranie.Columns[c].Visible = false; normalItems.Add(dataMeranie.Columns[c].HeaderText); } refreshIncludeColumns(normalItems); checkedListBoxInclude.SetItemChecked(0, true); checkedListBoxInclude.SetItemChecked(2, true); }