//Method to sync textboxes with new datagrid selection //Clear textboxes if there is no datagrid selection left private void InitItems() { try { ModuleCodeTextBox.Text = ApprovedSubscriptionsDataGrid[0, 0].Value.ToString(); ModuleNameTextBox.Text = ApprovedSubscriptionsDataGrid[1, 1].Value.ToString(); } catch { ModuleCodeTextBox.Clear(); ModuleNameTextBox.Clear(); } }
//Method to sync textboxes with datagrid cell selected private void ApprovedSubscriptionsDataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { ModuleCodeTextBox.Text = ApprovedSubscriptionsDataGrid[0, e.RowIndex].Value.ToString(); ModuleNameTextBox.Text = ApprovedSubscriptionsDataGrid[1, e.RowIndex].Value.ToString(); } catch { ModuleCodeTextBox.Clear(); ModuleNameTextBox.Clear(); } }
//Method to sync textboxes with datagrid cells private void SubScriptionsOverviewDataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { ModuleCodeTextBox.Text = SubScriptionsOverviewDataGrid[0, e.RowIndex].Value.ToString(); ModuleNameTextBox.Text = SubScriptionsOverviewDataGrid[1, e.RowIndex].Value.ToString(); ModuleNotesTextBox.Text = SubScriptionsOverviewDataGrid[5, e.RowIndex].Value.ToString(); } catch { ModuleCodeTextBox.Clear(); ModuleNameTextBox.Clear(); ModuleNotesTextBox.Clear(); } }
//Method to sync textboxes with new datagrid selection //Clear textboxes if there is no datagrid selection left private void InitItems() { try { ModuleCodeTextBox.Text = SubScriptionsOverviewDataGrid[0, 0].Value.ToString(); ModuleNameTextBox.Text = SubScriptionsOverviewDataGrid[1, 1].Value.ToString(); ModuleNotesTextBox.Text = SubScriptionsOverviewDataGrid[5, 5].Value.ToString(); } catch { ModuleCodeTextBox.Clear(); ModuleNameTextBox.Clear(); ModuleNotesTextBox.Clear(); } }