private void checkAll(object sender, EventArgs e) { for (int i = 0; i < SelectedColumns.Items.Count; i++) { SelectedColumns.SetItemChecked(i, true); } }
private void AddinList_SelectedIndexChanged(object sender, EventArgs e) { grid.DataSource = null; SelectedColumns.Items.Clear(); if (AddinList.SelectedIndex == 0) { } else { grid.DataSource = Helper.Instance.GetDataSource((AddinList.SelectedItem as AddinView).Addin.DataControl); SelectedColumns.Items.Clear(); foreach (DataGridViewColumn column in grid.Columns) { SelectedColumns.Items.Add(column.Name); SelectedColumns.SetItemChecked(SelectedColumns.Items.Count - 1, true); } } }
private void AddinList_SelectedIndexChanged(object sender, EventArgs e) { if (AddinList.SelectedIndex == 0) // Open from CSV File { DataTable table = SquadronHelper.Instance.GetDataTableFromCSV(); if (table != null) { SelectedColumns.Items.Clear(); foreach (DataColumn c in table.Columns) { SelectedColumns.Items.Add(c.ColumnName); } grid.DataSource = table; } } else { OpenFromGrid(); } for (int i = 0; i < SelectedColumns.Items.Count; i++) { SelectedColumns.SetItemChecked(i, true); } if (grid.DataSource != null) { if (grid.DataSource is DataTable) { InfoLabel.Text = (grid.DataSource as DataTable).Rows.Count.ToString() + " rows"; } else { InfoLabel.Text = grid.Rows.Count.ToString() + " rows"; } } }