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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





24102 Jan 28,2005 06:52 AM UTC Jan 31,2005 08:31 AM UTC WinForms 11
Tags: GridControl
Hrvoje Voda
Asked On January 28, 2005 06:52 AM UTC

I want to set imageList.TransparentColor to default windows color! How? I have: imageList.TransparentColor=Color. and list of all available colors but not the deafult windows.

Administrator [Syncfusion]
Replied On January 28, 2005 07:08 AM UTC

Try imageList1.TransparentColor = SystemColors.

Hrvoje Voda
Replied On January 28, 2005 08:09 AM UTC

It''s not working. Something is missing.

Administrator [Syncfusion]
Replied On January 28, 2005 09:01 AM UTC

Are you saying that SystemColors.XXXXX does not list the windows colors? Or that your imageList.TransparentColor is not working as you expect? There may be other things you need to do like calling calling bitmap1.MakeTransparent to get things to work. Is this imagelist being used in a grid somehow. Depending on what you are doing, you may have to set some properties like this.gridDataBoundGrid1.SupportsTransparentBackColor = true; to get things to work. Can you send a little sample project showing what you are trying to do with your imagelist and the grid to support@syncfusion.com and mention this forum thread in the subject line? Them maybe we can spot teh problem you are having.

Hrvoje Voda
Replied On January 28, 2005 09:09 AM UTC

I have icon with white background in imageList collection. My grid has a windows default color settings for cell. I would like that my icon has the same background as grid. So, when i change windows settings color that icon background change into that color.

Administrator [Syncfusion]
Replied On January 28, 2005 10:14 AM UTC

I think you have to set bitmap1.MakeTransparent(Color.White); on the bitmap if you want the bitmaps transparent color to be white.

Hrvoje Voda
Replied On January 31, 2005 06:22 AM UTC

I made it transparent but it still has background!

Administrator [Syncfusion]
Replied On January 31, 2005 07:10 AM UTC

Please post a sample project showing the problem.

Hrvoje Voda
Replied On January 31, 2005 07:29 AM UTC

I''m calling AddColumnHeaderAttachment() function in another class. ---------------------------------------- public CtlGridDataTable() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(grid_PrepareViewStyleInfo); } public Syncfusion.Windows.Forms.Grid.GridBoundColumn AddColumnHeaderAttachment( ) { Syncfusion.Windows.Forms.Grid.GridBoundColumn gcol = new Syncfusion.Windows.Forms.Grid.GridBoundColumn(); imageIndex=0; gcol.HeaderText ="Attachment"; grid.SupportsTransparentBackColor =true; grid.GridBoundColumns.Add( gcol ); return gcol; } public void grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.RowIndex == 0 && e.ColIndex == m_nIdxAttach ) { e.Style.Text = ""; e.Style.CellType = "Static"; e.Style.CellAppearance =GridCellAppearance.Raised; e.Style.BackgroundImageMode= GridBackgroundImageMode.CenterImage; e.Style.BackgroundImage = imageList.Images[ 0 ]; imageList.TransparentColor =System.Drawing.Color.Silver ; } }

Administrator [Syncfusion]
Replied On January 31, 2005 07:48 AM UTC

Here is a sample. It has a red and blue bitmap in a column header. If you run the sample as is, you will see both the red and blue in the header. In the Form.Load, uncomment the MakeTransparent line and you will see only the red in the headder when you run the program. http://www.syncfusion.com/forums/Uploads/ColHeaderImage-0131.zip Tell me how to see the problem you are having in this sample.

Hrvoje Voda
Replied On January 31, 2005 08:11 AM UTC

I''m using gif image that is in imageList collection! So, all methods with icon is in imageList properties that doesn''t have method makeTransparent image.

Administrator [Syncfusion]
Replied On January 31, 2005 08:31 AM UTC

Try converting your icon to a bitmap (icon.ToBitmap()) and use the bitmap in the grid setting its tranparent color once it is a bitmap. Again, if you will post a sample project that I can run and see the problem, I will try to give you a solution.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon