This is a migrated thread and some comments may be shown as answers.

Image Background for Grid Header

3 Answers 112 Views
GridView
This is a migrated thread and some comments may be shown as answers.
justin coon
Top achievements
Rank 1
justin coon asked on 21 Nov 2007, 08:10 PM
Hello all-

I would like to use a background image for the header of the datagridview....seems this is very difficult to do

Any help?

Thanks
Justin

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 22 Nov 2007, 12:21 PM
Hi justin coon,

Thank you for writing.

You can set an image as the background of the RadGridView by using the following code:

this.radGridView1.BackgroundImage = Resources.background; 
this.radGridView1.BackgroundImageLayout = ImageLayout.Tile; 
 

To set a background image only for the RadGridView header, you should modify a theme or do it programmatically. You must set the DrawFill property to a value of false for all columns in RadGridView header and set the Image property of GridHeaderRowElement.

Refer to the code snippet below:

GridHeaderRowElement headerRow = (GridHeaderRowElement)this.radGridView1.MasterGridViewInfo.TableHeaderRow.VisualElement; 
headerRow.Image = Resources.background; 
headerRow.ImagePosition = Telerik.WinControls.ImagePositions.Tile; 
 
foreach (GridCellElement cell in headerRow.Children) 
      cell.DrawFill = false

Don't hesitate to contact us if you have other questions.

All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
justin coon
Top achievements
Rank 1
answered on 26 Nov 2007, 09:33 PM
Is this possible in the windows forms version of the control?
0
Jack
Telerik team
answered on 27 Nov 2007, 12:30 PM
Actually, justin, our answer relates directly to the Windows Forms RadGridView (the namespace of the ASP.NET counterpart is just RadGrid). If you need information related to the web version of the control, please post in the "Grid for ASP.NET" forum.

 
All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
justin coon
Top achievements
Rank 1
Answers by
Jack
Telerik team
justin coon
Top achievements
Rank 1
Share this question
or