开发者

Can we overlay a WPF element by another?

开发者 https://www.devze.com 2023-02-14 19:31 出处:网络
I\'ve this situation: A label placed in Footer Cell of a RadGridView doesn\'t have sufficient width availab开发者_StackOverflow社区le in its container for displayingits full text.

I've this situation:

A label placed in Footer Cell of a RadGridView doesn't have sufficient width availab开发者_StackOverflow社区le in its container for displaying its full text.

Is it possible by any ways to have the label cross its container boundaries and show full text?

Thanks!


The space given to any element depends on the parent control or Panel that contains it, as well as its Width, Height, Horizontal and VerticalAlignment, and Margin. Normally you can manipulate some combination of these directly to change overlapping behavior but by using a DataGrid control you've given up a lot of that control since things like ColumnSpan are set up by the control internally. You could try setting negative Margin values and changing the Panel.ZIndex but I doubt those will help.

The best solution I can recommend without more detail is to use TextWrapping or TextTrimming to avoid ugly clipping, maybe in combination with a ToolTip showing the full text.


You can overlay any WPF element by another anytime. Only place where it fails is the WebBrowser control .The WPF WebBrowser has not been improved a single bit from WinForms WebBrowser. It is still the same simple activex control. However, you can bypass even that with a tooltip control.


I believe you can either set ClipToBounds=False to allow it to expand outside its area, or set TextWrapping=Wrap to allow the text to wrap.

EDIT: Forgot ClipToBounds is only honored in the Canvas control, so wrap your label in a Canvas and set ClipToBounds=False and it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消