开发者

WPF Multiline ToolTip with data binding

In our WPF application we show a data bound GridView, and one of the grid fields is a filter field which is combination of several sub-fields. In the grid, I show a simple string concatenation of the field, but I want the ToolTip to show a formatted presentation of the filter. The formatted presentation might contain some or all of the filter fields.

I can freely change the class bound to the grid.

Can you recommend a way to bind the ToolTip to the data, by adding some sort of a field, so it is nicely displayed, with multiple lines and indentation? I'd like to avoid specifying all the fields I need in the XAML and hide them based on the data, but I will probably do so if I don't come with a better approach. Another option might be to build the ToolTip structure in code in the ToolTipOpening event. Do you have a bett开发者_C百科er idea?


I was having same scenario and was using DataTrigger in the Tooltip's Style to hide and show fields in tooltip based on their values.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜