开发者

Getting text to bleed out of a DataGridCell in Silverlight, but not bleed out of DataGrid

开发者 https://www.devze.com 2023-02-18 14:08 出处:网络
Sort of an odd and specific problem here, but I\'m trying to figure out a clean way to have an object in Silverlight (in my case a TextBlock) bleed out of a DataGridCell, but not bleed out of the cont

Sort of an odd and specific problem here, but I'm trying to figure out a clean way to have an object in Silverlight (in my case a TextBlock) bleed out of a DataGridCell, but not bleed out of the containing DataGrid.

For example:

[      ][      ][      ][      ]
[      ][    Bl][eed   ][      ]
[      ][      ][      ][      ]

I don't exactly what the text itself to be in two different cells, but rather I'd like the text to overlap.

What I want to avoid though is this:

[      ][      ][      ][      ]
[      ][  开发者_Go百科    ][      ][    Bl]eed
[      ][      ][      ][      ]

In this case, I'd rather it look like:

[      ][      ][      ][      ]
[      ][      ][      ][    Bl]
[      ][      ][      ][      ]

Currently, I've tried to change the CellTemplate so that my TextBlock is contained within a PopUp control, and the PopUp is always open. This doesn't work though, because by using the PopUp, it will bleed outside the DataGrid. To get around this, I tried to then give the DatGrid a Clip rectangle, but that didn't work - the PopUp is still visible outside the DataGrid.

Hoping someone has a clean and simple solution to this method. The best case would be some sort of magical DataGrid.ColumnSpan or DataGridColumn.ColumnSpan that I'm not aware of...


Right tool for the right job. I switched to a Canvas.

0

精彩评论

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

关注公众号