WPF Toolkit 数据网格中有没有一种方法可以在列标题下方但第一行上方设置标题

发布于 2024-07-17 00:13:17 字数 246 浏览 5 评论 0原文

我正在寻找一种方法来创建一个区域,指示用户位于 WPF Toolkit 数据网格的顶行。 (显示向下滚动的滚动条对于用户来说是不够的)。 我需要一些突出的东西,基本上说“这是顶行”。 弄乱网格绑定的实体对我来说不起作用,因为我有几个网格,在同一实体集合上有不同的过滤器。 此外,当应用程序运行时,这个底层集合也会发生变化。

有没有办法在列标题和数据网格的第一行之间添加某种控件? 也许是某种分隔符?

谢谢! 乔恩

I looking for a way to create an area that indicates a user is at the top row of the WPF Toolkit datagrid. (Showing the scrollbar scrolled down is not enough for the user). I need something that sticks out and says "this is the top row" basically. Messing with the entities that that the grid is bound to will not work for me because I have several grids with different filters over the same collection of entities. Also this underlying collections is changing while the app is running.

Is there a way to add a control of some sort between the column headers and the first row of the datagrid? Maybe a separator of some sort?

Thanks!
Jon

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

写给空气的情书 2024-07-24 00:13:17

一个可能的解决方案是使用 ColumnHeaderTemplate 为列标题创建您自己的模板,并在其中显示您需要的任何内容。 这样您就可以完全控制标题的外观。

另一个黑客解决方案可能是更改标题的样式以达到所需的效果,例如将底部边距设置为更高的值,以便标题和第一行之间有一个空格。

A possible solution is to create your own Template for the column headers with ColumnHeaderTemplate and show whatever you need in there. This way you'll have full control of what your header looks like.

Another hackish solution could be you change the Style of the header to achieve the desired effect, like setting the bottom margin to a higher value so that there is a space between the header and the first row.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文