Telerik (rad)gridview 的奇怪行为
我有一个 WPF 应用程序,其中 GridView 绑定到 IQueryable<>直接从数据库表加载的集合。 该表包含一些文本字段。问题是GridView会根据行的长度自动增加所有行 TEXT 字段的值。这意味着如果 TEXT 字段的值有 5 行某些文本,则适当的 GridView 行会增加其值 高度并显示所有 5 条线。我需要 GridView 为单行文本提供相同静态高度的所有行 (文本字段带有省略号按钮)。可以做这样的事情吗?
I have a WPF application with a GridView bound to an IQueryable<> collection wich is loaded directly from a database table.
This table holds some TEXT fields. Problem is that the GridView automatically increases all rows according to the length of
the TEXT field's value. Meanang that if the TEXT field's value has 5 lines of some text, proper GridView row increases its
height and shows all 5 lines. I need the GridView to have all rows of the same static height just for a single line of text
(with an ellipsis button for TEXT field). Is it possible to do something like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽量避免自动生成列并手动设置列宽。它应该防止这种行为。
如果您想更进一步,可以为单元格分配一个模板,并在模板中放入不换行的文本。
此致
Try to avoid auto-generated columns and set manually the column widths. It should prevent that behavior.
If you want to go further, you can assign a template to cells and put in the template a text that does not wrap.
Best regards