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

How to change the image size in a group grid cell? (no content)

[No content]

1 Reply

SS Suresh Sekarean Syncfusion Team September 26, 2007 01:49 PM UTC

Hi Stanley,

The Style object of Image type cell has a property, 'ImageSizeMode' which indicates how the image will be displayed. If this property is set with 'AutoSize', the image size will be the cell size but keeping Height/width proportionally.

[C#]

private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.Style.CellType == "Image")
{
e.Style.ImageSizeMode = GridImageSizeMode.AutoSize;
//Image will be center in cell
e.Style.ImageSizeMode = GridImageSizeMode.CenterImage;
//Image is displayed with its default size
e.Style.ImageSizeMode = GridImageSizeMode.Normal;
//Image will be stretched to fit with the cell
e.Style.ImageSizeMode = GridImageSizeMode.StretchImage;


//Also we can change the image size by changing the Column Width.
//e.TableCellIdentity.Column.Width = 10;
}
}

Please let us know if you have any further queries.

Regards,
Sureshsekaran.

Loader.
Live Chat Icon For mobile
Up arrow icon