Ejemplo n.º 1
0
 private void buttonClear_Click(object sender, EventArgs e)
 {
     SelectedBugs.Clear();
     foreach (DataGridViewRow row in dataGridViewBugs.Rows)
     {
         row.Cells[0].Value = false;
     }
 }
Ejemplo n.º 2
0
 void dataGridViewBugs_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == _linkCol.Index)
     {
         _singleBugPresenter.ShowBug((IBug)bindingSourceBugs.Current);
     }
     else if (e.ColumnIndex == 0)            //Our check box
     {
         if (dataGridViewBugs.Rows[e.RowIndex].Cells[0].EditedFormattedValue != null && (bool)dataGridViewBugs.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true)
         {
             SelectedBugs.Add((IBug)bindingSourceBugs.Current);
         }
         else
         {
             SelectedBugs.Remove((IBug)bindingSourceBugs.Current);
         }
     }            //end if
 }
Ejemplo n.º 3
0
        void bindingSourceBugs_DataSourceChanged(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridViewBugs.Rows)
            {
                IBug bug = row.DataBoundItem as IBug;
                if (bug == null)
                {
                    continue;
                }

                //Set the check state to true if bug has been selected
                if (SelectedBugs.Contains((IBug)row.DataBoundItem))
                {
                    row.Cells[0].Value = true;
                }

                if (!bug.IsResolved)
                {
                    continue;
                }

                //Set the font style for resolved bugs to be FontStyle.Strikeout
                foreach (DataGridViewCell cell in row.Cells)
                {
                    if (cell.OwningColumn.GetType() != typeof(DataGridViewTextBoxColumn))
                    {
                        continue;
                    }

                    if (cell.Style.Font == null)
                    {
                        cell.Style.Font = new Font(dataGridViewBugs.DefaultCellStyle.Font, FontStyle.Strikeout);
                    }
                    else
                    {
                        cell.Style.Font = new Font(row.Cells[1].Style.Font, FontStyle.Strikeout);
                    }
                }        //end foreach
            }            //end foreach
        }