How to write code in C#, Asp.Net, Php, Javascript, C. On this blog you will find example codes that will help you to understand concepts of programming.

Wednesday, May 29, 2013

How to set the background color of a grid column header panel, DevExpress?

If you want to set the background color of a XtraGrid control from DevExpress controls you might get into some problems. Why? Because you can indeed find property Appearance.HeaderPanel.BackColor, then you set it and however no influence on grid. Why? Because you have to make another set :) But is not specified anywhere in info places.
So how do solve this?
In order to set background color of a GridControl, winforms you have to:
-go to gridControl and set Style to Flat;
-set UseDefaultLookAndFeel to False

-go to gridview and set Appearance.HeaderPanel.BackColor - your color (this will automatically set useBackColor to true, also)