Hi,
I want to dynamically add an unbound column on my grid.
This unbound column will display an image depending on the data bound.
e.g.
AnimalID Name UnboundCol
1 Dog Shows an image of a dog based on Animal ID = 1
2 Cat Shows cat image
Handle the InitializeLayout event, and add a new UltraGridColumn instance to the Columns collection of the band that should contain it, making that column's DataType typeof(Image), and assign an EmbeddableImageRenderer to its Editor property.
Example:private void ultraGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e){ ColumnsCollection columns = e.Layout.Bands[0].Columns; UltraGridColumn imageColumn = columns.Add( "imageColumn" ); imageColumn.DataType = typeof(Image); imageColumn.Editor = new EmbeddableImageRenderer();}
That's a great help. But how can I intercept the values of the databound column and display the appropriate image?
Thanks again!
You can use the grid's InitializeRow event handler for that.