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.
Syncfusion Feedback

Unable to center image in GridControl cell

Thread ID:

Created:

Updated:

Platform:

Replies:

34124 Sep 2,2005 09:54 AM UTC Sep 2,2005 02:05 PM UTC Windows Forms 3
loading
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 3.2.1.0. 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

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.

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

;