I was trying to show a "paper clip" icon in a cell in our application. However, for some reasons, the image has some blue stuff in the lower right hand corner as shown in the attachment.
Here is the code I used
UltraTreeNodeColumn nodeColumn = columnSet.Columns.Add(row["DisplayColName"].ToString());
nodeColumn.DataType = typeof(System.Drawing.Bitmap);
nodeColumn.Editor = new Infragistics.Win.EmbeddableImageRenderer();
nodeColumn.ColumnSet.CellAppearance.ImageHAlign = Infragistics.Win.HAlign.Center;
nodeColumn.ColumnSet.CellAppearance.ImageVAlign = Infragistics.Win.VAlign.Middle;
columnSet.Columns[row["DisplayColName"].ToString()].Tag = "LinksValue";
...
Image image = _tree.ImageList.Images[0];
childNode.SetCellValue(childNode.DataColumnSetResolved.Columns[sKey], image);
I know it might not be Wintree problem since the image was displayed fine in my standalone demo program but I just don't know where to look at for this problem.
Thanks.
Hi,
This could just be a shadow. Instead of setting the Editor on the column, try setting the Style to Image and see if that helps.
If not, then see what happens if you display the same image in a PictureBox control or some other inbox control.
Not sure what you mean by "setting the Style to Image". Does it mean to set the the alignment in the cell itself when setting the image value instead of in the node column? If not, can you provide some sample codes for demo?
Sorry, I was talking about the Style property on the WinGrid column, but you are using the tree, so please just ignore that.
Try this:
//nodeColumn.Editor = new Infragistics.Win.EmbeddableImageRenderer(); EmbeddableImageRenderer embeddableImageRenderer = new EmbeddableImageRenderer(); embeddableImageRenderer.DrawBorderShadow = false; nodeColumn.Editor = embeddableImageRenderer;
IT WORKS!!! Thank you very much. I didn't realize a change in the Wintree code fixed it since the shadow was not shown in my standalone program and they both used the same code. I thought somehow some UI styles or properties were overwritten by the parent containers in our application.
Speaking of it, I have 2 similar problems as shown in the attachment.
- I didn't set a specific style (or if there's any to set) about it in my code but my standalone program shows +/- as icons for the expansion/contraction while our application shows the triangles. Is there a way to set it to +/-?
- I set the text color in the node (for example, "Reminders") to be white in both the standalone program and our application. However, it doesn't work in the latter which remains in black color. What would have overridden the property?
jamesyip said:- I didn't set a specific style (or if there's any to set) about it in my code but my standalone program shows +/- as icons for the expansion/contraction while our application shows the triangles. Is there a way to set it to +/-?
This is controlled by the DisplayStyle property of the tree.
jamesyip said:- I set the text color in the node (for example, "Reminders") to be white in both the standalone program and our application. However, it doesn't work in the latter which remains in black color. What would have overridden the property?
It's tough to say. The resolution process for a node's appearance is pretty complex and there are many factors and properties where you can apply appearances on many different levels. You will need to check your code for appearance settings.
You should also try setting UseOsThemes to false, but I doubt this would affect the forecolor.
Also, see if you are loading a style library into your application via the StyleManager.Load method.