Currently I am adding images into cells (effectively replacing the UltraValidator) but I've run into some problems with the image format and so forth.My question is: Which format does my image need to be in to be used in a cell? Dimensions? And what encoding should I use? ie) A .bmp may be saved in R5 G5 B5 or R8 G8 B8 etc
Here's a nice clear, concise image we are familiar with.
.
Here's an example of what my images appear as.. and yes I did add an alpha layer which doesn't seem to be working.
rzabransky said:It is my understanding that the CreationFilter is only called when the UIElement is first constructed.
Well, no, not really. UIElements are very transitory objects. They get created and destroyed all the time. So you are sort've correct that the CreationFilter fires when the elements are created. But not just the first time they are created - it happens every time they are created, and also when they are moved around or really any time anything in the control changes that requires updating the UIElements.
So the CreationFilter is ideal for modifying the ToolTipItem, as it will get triggered any time anything is changed.
The Cell.Appearance.Image property is excellent! That helps immensely. I had already begun to handle some text overflow and button elements but this is very handy.
It is my understanding that the CreationFilter is only called when the UIElement is first constructed. This behaviour is not useful to me as I require access to the UIElement while the user enters data. With the UIElement I can set the ToolTipItem to a class object which implements IToolTipItem and assume full control over the tooltip.The original need for this was a slight frustration on the limitations of how an UltraValidator would validate certain data and ultimately not display the tooltip when they are set properly within an embedded editor component (such as UltraComboEditor).
I recall earlier you mentioned using IDataErrorInfo (or the likes for error checking within a grid) but for a consistent L&F this was not possible. With a now greater understanding of how it all works this could be implemented simply I believe.Thanks for all your help, I will conclude to say the Image property on a cell was the answer to my original post.
Hi,
I have created a support case for your behalf (CAS-51244-KS2XP8). Please send me more details about your scenario and I will research the options for you.
Regards,
Stefaniya
The problem with a DrawFilter is that you are simply drawing onto the grid. The grid has no knowledge that you did so, and so you might be drawing over other objects in the grid.
rzabransky said: - I am able to draw custom images where they are required. This includes headers, within dropdowns, etc.
Cell, Headers, and DropDowns in the grid all have the ability to show images, already via property settings on the Appearance.So using a DrawFilter doesn't really gain you anything, it's just a lot more work and a lot more code for the same effect. And, it has the disadvantage of the grid not moving the other elements around to fit the image.
rzabransky said:- I can use it as a cycle to immediately validate user entry and display feedback.
True, but you could achieve the same thing by handling events of the grid such as InitializeRow.
rzabransky said:- It allows me to attach customized tooltips to embedded UI elements. (especially editor components)
A CreationFilter would be better than DrawFilter for this.
I'm not trying to say that you should not be using a DrawFilter, I'm just trying to figure out exactly what you want to achieve so I can tell you the easiest way to do it. There are some very good reasons to use DrawFilters in some cases, but in most cases, using the properties on the grid is easier.
I think you would have a lot less trouble setting the appearance on a cell to provide an image, since this would handle the sizing and positioning of the image for you and all of your original questions in this thread would be solved. Or even setting the column's CellAppearace.Image to an empty image and then using the DrawFilter to draw into the ImageUIElement inside each cell would simplify things a lot, since the grid would reserve the image space and you could use the size of the ImageUIElement to determine the size to draw your image.
Using a DrawFilter allows for several things to occur. - I am able to draw custom images where they are required. This includes headers, within dropdowns, etc.
- I can use it as a cycle to immediately validate user entry and display feedback.
- It allows me to attach customized tooltips to embedded UI elements. (especially editor components)
I value your suggestions, so if you can think of a better way to achieve all of the above I will certainly consider them.