Ejemplo n.º 1
0
 //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();
     }
 }
Ejemplo n.º 2
0
 //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();
     }
 }