Пример #1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            int row;

            try
            {
                row = Convert.ToInt32(dataGridView1[0, Convert.ToInt32(dataGridView1.CurrentRow.Index)].Value);
                EditColor EC = new EditColor(Convert.ToInt32(dataGridView1[0, row - 1].Value), dataGridView1[1, row - 1].Value.ToString());
                if (EC.ShowDialog() == DialogResult.OK)
                {
                    dataGridView1.DataSource = EC.getDataTable;
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.GetBaseException().ToString());
            }
        }
Пример #2
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int row;

            try
            {
                row = e.RowIndex;
                EditColor EC = new EditColor(Convert.ToInt32(dataGridView1[0, row].Value), dataGridView1[1, row].Value.ToString());
                if (EC.ShowDialog() == DialogResult.OK)
                {
                    dataGridView1.DataSource = EC.getDataTable;
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.GetBaseException().ToString());
            }
        }
Пример #3
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     int row;
     try
     {
         row = Convert.ToInt32(dataGridView1[0, Convert.ToInt32(dataGridView1.CurrentRow.Index)].Value);
         EditColor EC = new EditColor(Convert.ToInt32(dataGridView1[0, row - 1].Value), dataGridView1[1, row - 1].Value.ToString());
         if (EC.ShowDialog() == DialogResult.OK)
         {
             dataGridView1.DataSource = EC.getDataTable;
         }
     }
     catch (Exception x)
     {
         MessageBox.Show(x.GetBaseException().ToString());
     }
 }
Пример #4
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     int row;
     try
     {
         row = e.RowIndex;
         EditColor EC = new EditColor(Convert.ToInt32(dataGridView1[0, row].Value), dataGridView1[1, row].Value.ToString());
         if (EC.ShowDialog() == DialogResult.OK)
         {
             dataGridView1.DataSource = EC.getDataTable;
         }
     }
     catch (Exception x)
     {
         MessageBox.Show(x.GetBaseException().ToString());
     }
 }