Пример #1
0
        private FontStyle?GetRowFontStyle(DataGridViewRow row, Enova.Business.Old.DB.Web.TowarAtrybut towarAtrybut)
        {
            if (towarAtrybut.SelectListForeColor != null && towarAtrybut.SelectListBackColor != null)
            {
                return(row.Selected ? FontStyle.Bold : FontStyle.Regular);
            }

            return(null);
        }
Пример #2
0
        private Color?GetRowBackColor(Enova.Business.Old.DB.Web.TowarAtrybut towarAtrybut)
        {
            if (ColorHelper.TryParseColorFromHtml(towarAtrybut.SelectListBackColor, out Color color))
            {
                return(color);
            }

            return(null);
        }
Пример #3
0
        private Color?GetRowForeColor(Enova.Business.Old.DB.Web.TowarAtrybut towarAtrybut)
        {
            if (ColorHelper.TryParseColorFromHtml(towarAtrybut.SelectListForeColor, out Color color))
            {
                return(color);
            }

            return(!towarAtrybut.Dostepny ? Color.Red : (Color?)null);
        }
Пример #4
0
 private void produktyWebDataGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     if (e.RowIndex >= 0 && e.RowIndex < produktyWebDataGridView.Rows.Count)
     {
         var row = produktyWebDataGridView.Rows[e.RowIndex];
         if (row.DataBoundItem != null)
         {
             Enova.Business.Old.DB.Web.TowarAtrybut ta = (Enova.Business.Old.DB.Web.TowarAtrybut)row.DataBoundItem;
             SetRowBackColor(row, GetRowBackColor(ta));
             SetRowForeColor(row, GetRowForeColor(ta));
             SetRowFontStyle(row, GetRowFontStyle(row, ta));
         }
     }
 }