We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

icon into GridHeader

Thread ID:

Created:

Updated:

Platform:

Replies:

24036 Jan 27,2005 05:12 AM Jan 27,2005 07:58 AM Windows Forms 7
loading
Tags: GridControl
Hrvoje Voda
Asked On January 27, 2005 05:12 AM

i would like to put an icon into gridHeader but by writting a code

Administrator [Syncfusion]
Replied On January 27, 2005 05:21 AM

For a GridControl, try adding these lines to the Form_Load event to show an icon in col header 3. ImageList imageList = new ImageList(); imageList.Images.Add(SystemIcons.Warning.ToBitmap()); imageList.Images.Add(SystemIcons.Application.ToBitmap()); this.gridControl1[3,0].ImageList = imageList; this.gridControl1[3,0].CellType = "Static"; this.gridControl1[3,0].ImageIndex = 0; If you want the cell to keep the 3d appearance, also set the style.CellAppearance property. If you are using a GridDataBoundGrid, then you would need to handle PrepareViewStyleInfo to set the same properties on e.Style based on the values of e.ColIndex and e.RowIndex.

Hrvoje Voda
Replied On January 27, 2005 06:04 AM

I''m trying to put icon in CellHeader 2 but i can only put in CellHeader 0! Why?

Administrator [Syncfusion]
Replied On January 27, 2005 06:22 AM

Are you using a GridDataBoundGrid? If so, you cannot use the code snippets above. You have to use PrepareViewStyleInfo.

Hrvoje Voda
Replied On January 27, 2005 07:07 AM

I''m using BoundControl but I don''t know how to use ColIndex? e.ColIndex ?

Administrator [Syncfusion]
Replied On January 27, 2005 07:21 AM

Here is a link to a sample. http://www.syncfusion.com/forums/Uploads/GDBG_ImageInColHeader.zip

Hrvoje Voda
Replied On January 27, 2005 07:51 AM

Great! Now it all works! I just have one more question and then i want ask it ever again! :) How do i put that icon in center of a CellHeader? There is now method for it within Cell properties

Administrator [Syncfusion]
Replied On January 27, 2005 07:58 AM

Instead of setting CellType = "Static", try this code. e.Style.CellType = "Image"; e.Style.ImageSizeMode = GridImageSizeMode.CenterImage;

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;