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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unable to center image in GridControl cell

Thread ID:





34124 Sep 2,2005 09:54 AM UTC Sep 2,2005 02:05 PM UTC WinForms 3
Tags: GridControl
Geir Aamodt
Asked On September 2, 2005 09:54 AM UTC

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 10:26 AM UTC

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 12:28 PM UTC

Ah, thanks Jeba for quick and accurate solution!

Administrator [Syncfusion]
Replied On September 2, 2005 02:05 PM UTC

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.

Please sign in to access our forum

or the page will be automatically redirected to 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