1、 Add event CustomDrawColumnHeader
private void gvw1_CustomDrawColumnHeader(object sender, DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventArgs e)
  if (e.Column == null || (e.Column.AppearanceHeader.BackColor == Color.Empty && !e.Column.AppearanceHeader.Options.UseBackColor))
  Rectangle rect = e.Bounds;
  rect.Inflate(-1, -1);
  // Fill Title Color .
  e.Graphics.FillRectangle(new SolidBrush(e.Column.AppearanceHeader.BackColor), rect);
  e.Appearance.DrawString(e.Cache, e.Info.Caption, e.Info.CaptionRect);
  // Draw the filter and sort buttons .
  foreach (DrawElementInfo info in e.Info.InnerElements)
    if (!info.Visible) continue;
    ObjectPainter.DrawObject(e.Cache, info.ElementPainter, info.ElementInfo);
  e.Handled = true;
2、 Set column header color
gvw1.Columns["Zxnum"].AppearanceHeader.BackColor = Color.Yellow;
gvw1.Columns["Zxnum"].AppearanceHeader.ForeColor = Color.Black;

dev gridControl Custom draw column header color more related articles

  1. WPF DEV gridcontrol Custom calculated Columns (TotalSummary)

    /// <summary> /// Custom calculated Columns /// </summary> /// <param name="sender"></pa ...

  2. Dev gridcontrol Add multi column button

    gridcontrol To add a button to the : 1. Put the list of ColumnEdit Property is set to RepositoryItemButtonEdit 2. hold TextEditStyle Property is set to HideTextEdi ...

  3. DevExpress in GridControl Custom summary column values ( Selective aggregation )

    Today, I met with a colleague's demand in this aspect , Stick it . private void gvTop_CustomSummaryCalculate(object sender, CustomSummaryEventAr ...

  4. Winform DataGridView Add column header checkbox

    using System; using System.Data; using System.Drawing; using System.Windows.Forms; using Yanwen.Logi ...

  5. [DevExpress]GridControl Column header drawing Checkbox

    Key code : /// <summary> /// Draw... For the column head CheckBox /// </summary> /// <param name="view" ...

  6. Realize in DevExpress.XtraGrid.GridControl To achieve the function of selecting all

    First, create a new one Win Form Test project , Drag one GridControl Control to the form . public partial class Form1 : Form { public Form1() { Initia ...

  7. gridcontrol Right click menu of column header

    Dev Control GridControl Set up a right-click menu this.gridControl1.ContextMenu = contextMenu2; and GridControl When running sort , namely gridv ...

  8. [DevExpress]GridControl Synchronize column headers checkbox And column checkbox state

    Key code : /// <summary> /// Synchronize column headers checkbox And column checkbox state /// </summary> /// <param name=&quo ...

  9. DEV GridControl.TableView FocusedRow Select the line background color

    Last time I changed TableView.RowStyle, It leads to a problem : covers GridControl The default color of the selected line . So you need to rewrite the color of the selected line . The idea at first was : <dxg:TableView> ...

Random recommendation

  1. Apache Solutions to startup errors

    xampp The error displayed at startup is : 10:40:18 [Apache] Error: Apache shutdown unexpectedly.10:40:18 [Apache] This may be ...

  2. About DOS And cmd(windows System )

    dos It's the earliest operating system of a computer , To operate a computer, you have to input all kinds of dos Command window , It can be understood as running the internal language of a computer , Do you know programming ? In fact, in the early days dos Command operating system is to run the programming commands inside the computer , Therefore, all operators must have a certain ...

  3. 【 turn 】 About LinQ The dynamics of the Or Inquire about

    /// <summary> /// Constructor uses True when : Single AND It works , Multiple AND It works : Single OR Invalid , Multiple OR Invalid : When mixing, write in AND After OR It works /// Constructor uses False when : Single ...

  4. Java_Web Learning route

  5. maven Frequently used scripts

    Maven library : http://repo2.maven.org/maven2/ Maven Dependent query : http://mvnrepository.com/ Maven Common commands : 1. establish Maven Ordinary ...

  6. 5 Seed network IO Model

    5 Seed network IO Model ( A figure , Very clear )   Sync (synchronous) IO And asynchronous (asynchronous) IO, Blocking (blocking) IO And non blocking (non-blocking)IO What are the differences , To ...

  7. 【 Tamp PHP Basics 】PHPUnit -- PHP The test framework

    This paper addresses Share the outline : 1. summary 2. install 3. Write the first test case 4.PHPUnit senior 5. Reference resources 1. summary 1)[ The test framework ] It's a lightweight PHP The test framework , It's a xUnit Unit testing framework for the architecture of ...

  8. SSH Integration plan 2 ( No hibernate.cfg.xml)

    The overall structure : 1. To introduce the relevant jar package 2. Write entity classes and mapping files package cn.zqr.domain; public class Customer { private Long cust_id; p ...

  9. 【PyQt5-Qt Designer】PyQt5+eric6 install and configure

    PyQt5+eric6 Installation and configuration 1. utilize pip Command to install PyQt5 First step : install PyQt5 stay cmd Enter... On the command line : pip install PyQt5 The second step : install Qt The toolkit pip instal ...

  10. [ turn ] map/reduce

    If you have read Google The well-known paper of “MapReduce: Simplified Data Processing on Large Clusters”, You can get a general idea of map/reduce The concept of . ...