首页 > 其他 > 详细

devexpress GridControl 行指示列图标绘制

时间:2016-05-29 23:01:39      阅读:505      评论:0      收藏:0      [点我收藏+]
  •  Row Indicator Panel

The row indicator panel represents a region displayed at the left edge of the View. The panel contains row indicator cells corresponding to different View sections (the band header panel, the column header panel, data rows, the View footer, etc). The cell relating to the focused row indicates the row state (whether it is in edit mode or has been modified, etc.). When multiple selection is enabled, end-users can click cells and then drag the mouse cursor to another cell to select a range of rows.

 

技术分享

The following icons can be displayed within an indicator panel.
  • 技术分享 - Focused row.
  • 技术分享 - The focused cell‘s in-place editor is active.
  • 技术分享 - The focused row is modified.
  • 技术分享 - The focused row is a New Item Row.
  • 技术分享 - The focused row is an Auto Filter Row.
  • 技术分享 - Indicates the button used to maximize a detail View.
  • 技术分享 - Indicates the button used to restore a detail View.
  • 技术分享 - The focused row contains errors.
  • 技术分享 - A non-focused row contains errors.

 

The table below lists the main properties affecting element appearance.

Appearance The GridViewAppearances.HeaderPanel property specifies appearance settings used for painting all indicator cells, except for the cell relating to the band header panel. This cell is painted using the BandedViewAppearances.BandPanel property‘s settings.

An element‘s background colors cannot be changed when a View is painted using the Windows XP, Office2003, or any skinning paint style (see the BaseView.PaintStyleNameproperty).

Custom Draw Event The GridView.CustomDrawRowIndicator event.
Visibility The GridOptionsView.ShowIndicator option.
Width The GridView.IndicatorWidth property.

 

 

 

private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) {

           

           if (e.Info.IsRowIndicator){

               DataRow row = gridView1.GetDataRow(e.RowHandle);

               if (row != null && row.RowError != String.Empty) {

                   e.Info.ImageIndex = -1;

                   e.Painter.DrawObject(e.Info);

                   Rectangle  r = e.Bounds;

                   r.Inflate(-1, -1);

                   int x = r.X + (r.Width - imageList1.ImageSize.Width) / 2;

                   int y = r.Y + (r.Height - imageList1.ImageSize.Height) / 2;

                       e.Graphics.DrawImageUnscaled(imageList1.Images[0], x, y);

                   e.Handled = true;

               }

           } 

       }

 

  

 

devexpress GridControl 行指示列图标绘制

原文:http://www.cnblogs.com/janehlp/p/5540430.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!