GDBG - displaying an image in a column

hi there,

i have a GDBG that is binded to a data table. i would like to add a column to the grid that will display the same image in all of it's cells. how should i do this?

should i add a new column to the data table aswell? or is it posible adding a column to the grid that is unbinded to the datatable?

1 Reply

HA haneefm Syncfusion Team March 29, 2007 02:59 PM UTC

Hi Tzvika ,

is it posible adding a column to the grid that is unbinded to the datatable?
>>>>
Yes, It is possible by adding the unbound columns in grid. Here is a KB article that shows you "How do I insert an unbound check box column in a GridDataBoundGrid?".
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=305

Below is a code snippet for adding the image column in a grid. Please try the code snippet and let me know if this helps.

[C#]
GridBoundColumnsCollection column5 = (GridBoundColumnsCollection) this.gridDataBoundGrid1.Binder.InternalColumns.Clone();

GridBoundColumn Ucolumn5 = new GridBoundColumn();
Ucolumn5.HeaderText = "Image";
Ucolumn5.MappingName = "Image";
Ucolumn5.StyleInfo.CellType = "Image";
ImageList list = new ImageList();
list.Images.Add(SystemIcons.Exclamation.ToBitmap());

Ucolumn5.StyleInfo.ImageList = list;
Ucolumn5.StyleInfo.ImageIndex = 0;
column5.Add(Ucolumn5);

this.gridDataBoundGrid1.Binder.GridBoundColumns = column5;

Best Regards,
Haneef

Loader.
Up arrow icon