How to show images in Grid Groupinng Control cells.

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?

2 Replies

HA haneefm Syncfusion Team October 29, 2007 01:57 PM UTC

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


IN Iliya Nesterov October 29, 2007 02:38 PM UTC

Thank you!

Loader.
Up arrow icon