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.

How to show images in Grid Groupinng Control cells.

Thread ID:

Created:

Updated:

Platform:

Replies:

69456 Oct 29,2007 05:38 AM Oct 29,2007 10:38 AM Windows Forms 2
loading
Tags: GridControl
Iliya Nesterov
Asked On October 29, 2007 05:38 AM

How to load image into a cell? How to load image list and show indexed images in a cell?
Is it possible to load images in nested tables?

haneefm [Syncfusion]
Replied On October 29, 2007 09:57 AM

Hi Iliya,

How to load image into a cell?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
To load the image to particular column then you need to set the CellType,ImageList and ImageIndex property of the column's appearance object. Below are the codes:

this.gridGroupingControl1.TableDescriptor.Columns["Image"].Appearance.AnyRecordFieldCell.CellType = "Image";
this.gridGroupingControl1.TableDescriptor.Columns["Image"].Appearance.AnyRecordFieldCell.ImageList = list;
this.gridGroupingControl1.TableDescriptor.Columns["Image"].Appearance.AnyRecordFieldCell.ImageIndex = 1;

For NestedTables:
>>>>>>>>>>>>>>>>>>
GridTableDescriptor td1 = gridGroupingControl1.GetTableDescriptor("TableName");
td1.Columns["Image"].Appearance.AnyRecordFieldCell.CellType = "Image";
td1.Columns["Image"].Appearance.AnyRecordFieldCell.ImageList = list;
td1.Columns["Image"].Appearance.AnyRecordFieldCell.ImageIndex = 1;

If you want to load the image to particular gridcell then you need to handle the QueryCellStyleInfo event to set the CellType,ImageList and ImageIndex property of the Style object . Below are the codes:

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.Name == "Image")
{
e.Style.ImageIndex = e.TableCellIdentity.RowIndex % 4;
e.Style.ImageList = list;
e.Style.CellType = "Image";
}
}

Best regards,
Haneef

Iliya Nesterov
Replied On October 29, 2007 10:38 AM

Thank you!

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.

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.

;