I'm having a strange problem. I have a XamDataGrid (2011.2) that has a field with TextWrapping enabled. In some cases, the text seems to wrap prematurely independent of the width of the cell.
For instance - "Kit" shows up as "Ki" when not in edit mode, and "Kit" in edit mode. However, if I enter "Kite" or "kit" or "Kit XXX" or " the entire text shows up. If I shrink the column so that it only displays one or two characters per line, the entire word shows up, just on different lines.This seems to happen to
When I turn off text-wrapping, this problem goes away.
I've attached a sample project that demonstrates this - all of the words listed in the project are causing problems in my real project, but strangely, the only one causing a problem in the sample is "Bit".
How do I fix this (without turning off text wrapping)?
Hello,
Thank you for your post. I have been looking into it and the sample project you have attached and I suggest you add the following Setter to your XamTextEditor Style in the XamDataGrid’s FieldLayoutInitialized event:
cellEditorStyle.Setters.Add(new Setter(XamTextEditor.PaddingProperty, new Thickness(0)));
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks! That seems to have fixed the problem. I was wondering if you could tell me why this is necessary though? Just a bug?
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well. Also I can say that this behavior occurs by design and in most cases it looks nice, but it cannot cover all the Fonts, FontWeights and FontSizes.
Thanks again.