Ejemplo n.º 1
0
 /// <summary>
 /// finds the row of the previously selected product
 /// </summary>
 private void findRow()
 {
     SelectDataGridView.ClearSelection();
     foreach (DataGridViewRow row in SelectDataGridView.Rows)
     {
         if (row.Cells["productIDColumn"].Value.ToString().Equals(Program.selectedProduct.productID.ToString()))
         {
             row.Cells["costColumn"].Selected = true;
         }
     }
     DisplaySelected();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// event handler for returning to this form from the product info form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SelectForm_Activated(object sender, EventArgs e)
 {
     if (Program.selectedProduct != null)
     {
         NextButton.Enabled = true;
         findRow();
     }
     else
     {
         NextButton.Enabled = false;
         SelectDataGridView.ClearSelection();
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// on load checks if a previous selection was made and if so defaults to it
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectForm_Load(object sender, EventArgs e)
        {
            this.productsTableAdapter.Fill(this.cOMP1004DataSet.products);

            if (Program.selectedProduct != null)
            {
                NextButton.Enabled = true;
                findRow();
            }
            else
            {
                NextButton.Enabled = false;
                SelectDataGridView.ClearSelection();
            }
        }