private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            DataGridViewCell cell = dataGridViewX1.Rows[e.RowIndex].Cells[e.ColumnIndex];

            if (cell is CellGradeYear && cell.Value != null && !string.IsNullOrEmpty(cell.Value.ToString()))
            {
                CellGradeYear cellGradeYear = cell as CellGradeYear;
                cellGradeYear.Detail.ShowDialog();
                dataGridViewX1.Refresh();
            }
        }
        void Item_Click(object sender, EventArgs e)
        {
            if ((sender as ButtonItem).SubItems.Count > 0)
            {
                buttonItem1.ClosePopup();
            }

            if (dataGridViewX1.SelectedCells.Count > 0)
            {
                foreach (DataGridViewCell cell in dataGridViewX1.SelectedCells)
                {
                    if (cell is CellGradeYear && cell.Value != null && !string.IsNullOrEmpty(cell.Value.ToString()))
                    {
                        CellGradeYear cellGradeYear = cell as CellGradeYear;
                        cellGradeYear.SetCategory(new List <Student>(cellGradeYear.Students.Values), (sender as ButtonItem).Tag.ToString());
                    }
                }
                dataGridViewX1.Refresh();
            }
        }
Exemple #3
0
 public DetailForm(CellGradeYear parent)
 {
     InitializeComponent();
     _parent = parent;
     InitialMenuBarItem();
 }