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.

Unable to center image in GridControl cell

Thread ID:





34124 Sep 2,2005 05:54 AM Sep 2,2005 10:05 AM Windows Forms 3
Tags: GridControl
Geir Aamodt
Asked On September 2, 2005 05:54 AM

I''m trying to center a .bmp image in a cell in a GridControl grid. Know there been several posts about this, but I''m not able to get it working right, the image is always left-aligned in the cell. I''m using version This is my code: theGrid[i+1,1].CellType = "Static"; theGrid[i+1,1].ImageList = ((MainForm)TopLevelControl).MiscImages; theGrid[i+1,1].ImageIndex = 0; theGrid[i+1,1].HorizontalAlignment = GridHorizontalAlignment.Right; theGrid[i+1,1].ImageSizeMode = GridImageSizeMode.CenterImage;

Administrator [Syncfusion]
Replied On September 2, 2005 06:26 AM

By default, setting the CellType to Image aligns the Image to the center. For setting the Horizontal alignment of the Image, you need to set the GridImageSizeMode to either Normal / AutoSize. GridStyleInfo style ; style = this.gridControl1[1,3]; style.CellType = "Image"; style.ImageList = imageList1; style.ImageIndex = 2; style.ImageSizeMode=GridImageSizeMode.Normal; style.HorizontalAlignment=GridHorizontalAlignment.Center;

Geir Aamodt
Replied On September 2, 2005 08:28 AM

Ah, thanks Jeba for quick and accurate solution!

Administrator [Syncfusion]
Replied On September 2, 2005 10:05 AM

Hi Geir, Thank you for your update. We appreciate your interest in Syncfusion Prodcuts. Best Regards, Jeba


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.