Пример #1
0
        private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
        {
            GenreItem gi = (GenreItem)dataGrid1.CurrentItem;

            gi.Check = !gi.Check;
            dataGrid1.Items.Refresh();
        }
Пример #2
0
 private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
 {
     dataGrid1.Columns[1].IsReadOnly = true;
     try
     {
         GenreItem gi = (GenreItem)dataGrid1.CurrentItem;
         if (gi.Genre != null)
         {
             gi.Check = !gi.Check;
             dataGrid1.Items.Refresh();
         }
     }
     catch
     {
         dataGrid1.Columns[1].IsReadOnly = false;
     }
 }