Пример #1
0
 private void RdGrdReportResult_CellPaint(object sender, GridViewCellPaintEventArgs e)
 {
     try
     {
         if (e.Cell != null && e.Cell.RowInfo is GridViewDataRowInfo && e.Cell.ColumnInfo.Name.Contains("cPriceChange_"))
         {
             double value = Convert.ToDouble(e.Cell.Value);
             if (value == 0)
             {
                 return;
             }
             else if (value < 0)
             {
                 e.Graphics.DrawImage(Properties.Resources.DownArrowRed9X16, new PointF(0, 0));
             }
             else if (value > 0)
             {
                 e.Graphics.DrawImage(Properties.Resources.UpArrowGreen8X16, new PointF(0, 0));
             }
         }
         if (e.Cell != null && e.Cell.RowInfo is GridViewDataRowInfo && e.Cell.ColumnInfo.Name.Contains("cSummary"))
         {
             double value = Convert.ToDouble(e.Cell.Value);
             if (value == 0)
             {
                 return;
             }
             else if (value < 0)
             {
                 e.Graphics.DrawImage(Properties.Resources.DownArrowRed9X16, new PointF(0, 0));
             }
             else if (value > 0)
             {
                 e.Graphics.DrawImage(Properties.Resources.UpArrowGreen8X16, new PointF(0, 0));
             }
         }
     }
     catch (Exception ex)
     {
         ClsMessage._IClsMessage.ProjectExceptionMessage(ex);
     }
 }
Пример #2
0
 private void grdList_CellPaint(object sender, GridViewCellPaintEventArgs e)
 {
     GridHeaderCellElement header = e.Cell as GridHeaderCellElement;
     if (header != null && header.ColumnIndex == 3)
     {
         e.Graphics.DrawImage((toggleClick) ? ShayanResources.RscImage._checked : ShayanResources.RscImage.uncheck, header.BoundingRectangle.Width/2-8,header.Location.Y+5);
     }
 }