protected override void SetRowFormat(DataGridViewRow row)
        {
            if (!row.Displayed)
            {
                return;
            }
            if (row.IsNewRow)
            {
                return;
            }

            SesionCronogramaInfo item = (SesionCronogramaInfo)row.DataBoundItem;

            if (_total_dias == 6)
            {
                if (item.Dia % 2 == 0)
                {
                    row.DefaultCellStyle = SemanaParStyle;
                }
            }
            else
            {
                if ((item.Semana % 2 == 1 && item.Dia % 2 == 0) || (item.Semana % 2 == 0 && item.Dia % 2 == 1))
                {
                    row.DefaultCellStyle = SemanaParStyle;
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Asigna los valores del grid que no están asociados a propiedades
 /// </summary>
 protected override void SetUnlinkedGridValues(string gridName)
 {
     switch (gridName)
     {
     case "Sesiones_Grid":
     {
         int count = 1;
         foreach (DataGridViewRow row in Sesiones_Grid.Rows)
         {
             if (row.IsNewRow)
             {
                 continue;
             }
             SesionCronogramaInfo info = (SesionCronogramaInfo)row.DataBoundItem;
             if (info != null)
             {
                 if (info.OidClasePractica != 0)
                 {
                     row.DefaultCellStyle.BackColor = Color.RoyalBlue;
                     row.Cells[Duracion.Name].Value = info.Duracion;
                 }
                 else
                 {
                     if (info.OidClaseTeorica == -1)
                     {
                         row.DefaultCellStyle.BackColor = Color.Red;
                     }
                     else
                     {
                         row.DefaultCellStyle.BackColor = Color.White;
                     }
                 }
                 row.Cells[Indice.Name].Value = count++;
             }
         }
     } break;
     }
 }