void BindDataGridView() { if (_exception != null) { textBoxInfo.Text = ""; dataGridViewWorkflows.DataSource = new SortableBindingList <WorkflowDataInfo>(); ShowError(); return; } var sworkflows = new SortableBindingList <WorkflowDataInfo>(); _workflowsPerId = new Dictionary <int, WorkflowInfo>(); foreach (WorkflowInfo workflow in _workflows) { sworkflows.Add(new WorkflowDataInfo(workflow.Id, workflow.Name, workflow.LaunchType, workflow.IsEnabled, workflow.Description)); if (!_workflowsPerId.ContainsKey(workflow.Id)) { _workflowsPerId.Add(workflow.Id, workflow); } } dataGridViewWorkflows.DataSource = sworkflows; dataGridViewWorkflows.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridViewWorkflows.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[3].Name = ColumnEnabled; dataGridViewWorkflows.Columns[3].HeaderText = ColumnEnabled; dataGridViewWorkflows.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridViewWorkflows.Sort(dataGridViewWorkflows.Columns[0], ListSortDirection.Ascending); }
void BindDataGridView() { if (_exception != null) { MessageBox.Show( @"An error occured while retrieving workflows. Check Wexflow Web Service Uri and check that Wexflow Windows Service is running correctly.", @"Wexflow", MessageBoxButtons.OK, MessageBoxIcon.Error); textBoxInfo.Text = ""; return; } var sworkflows = new SortableBindingList <WorkflowDataInfo>(); _workflowsPerId = new Dictionary <int, WorkflowInfo>(); foreach (WorkflowInfo workflow in _workflows) { sworkflows.Add(new WorkflowDataInfo(workflow.Id, workflow.Name, workflow.LaunchType, workflow.IsEnabled, workflow.Description)); _workflowsPerId.Add(workflow.Id, workflow); } dataGridViewWorkflows.DataSource = sworkflows; dataGridViewWorkflows.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridViewWorkflows.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[3].Name = ColumnEnabled; dataGridViewWorkflows.Columns[3].HeaderText = ColumnEnabled; dataGridViewWorkflows.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridViewWorkflows.Sort(dataGridViewWorkflows.Columns[0], ListSortDirection.Ascending); }
private void BindDataGridView() { SortableBindingList <WorkflowDataInfo> workflows = new SortableBindingList <WorkflowDataInfo>(); foreach (WorkflowInfo workflow in this._workflows) { workflows.Add(new WorkflowDataInfo(workflow.Id, workflow.Name, workflow.LaunchType, workflow.IsEnabled, workflow.Description)); } this.dataGridViewWorkflows.DataSource = workflows; this.dataGridViewWorkflows.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; this.dataGridViewWorkflows.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; this.dataGridViewWorkflows.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; this.dataGridViewWorkflows.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; this.dataGridViewWorkflows.Columns[3].Name = COLUMN_ENABLED; this.dataGridViewWorkflows.Columns[3].HeaderText = COLUMN_ENABLED; this.dataGridViewWorkflows.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewWorkflows.Sort(this.dataGridViewWorkflows.Columns[0], ListSortDirection.Ascending); }
void BindDataGridView() { var sworkflows = new SortableBindingList <WorkflowDataInfo>(); _workflowsPerId = new Dictionary <int, WorkflowInfo>(); foreach (WorkflowInfo workflow in _workflows) { sworkflows.Add(new WorkflowDataInfo(workflow.Id, workflow.Name, workflow.LaunchType, workflow.IsEnabled, workflow.Description)); _workflowsPerId.Add(workflow.Id, workflow); } dataGridViewWorkflows.DataSource = sworkflows; dataGridViewWorkflows.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridViewWorkflows.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dataGridViewWorkflows.Columns[3].Name = ColumnEnabled; dataGridViewWorkflows.Columns[3].HeaderText = ColumnEnabled; dataGridViewWorkflows.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridViewWorkflows.Sort(dataGridViewWorkflows.Columns[0], ListSortDirection.Ascending); }