加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – DevExpress.Wpf.Grid.InfiniteGridSizeException未处理

发布时间:2020-12-15 23:33:11 所属栏目:百科 来源:网络整理
导读:使用DevExpress时,我看到此错误: DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled Message=”By default,an infinite grid height is not allowed since all grid rows will be rendered and hence the grid will work very slowly. To fix t
使用DevExpress时,我看到此错误:

DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled
Message=”By default,an infinite grid height is not allowed since all grid rows will be rendered and hence the grid will work very slowly. To fix this issue,you should place the grid into a container that will give a finite height to the grid,or you should manually specify the grid’s Height or MaxHeight. Note that you can also avoid this exception by setting the GridControl.AllowInfiniteGridSize static property to True,but in that case the grid will run slowly.”

解决方法

问题是DXGrid具有无限高度.

要修复,请将高度设置为非无限的.

Snoop绝对是非常宝贵的:

enter image description here

如果XAML元素的“高度”是无限的(即0或NaN),则可以使用以下方法之一进行设置:

>选项1:高度=“{绑定路径= ActualHeight,RelativeSource = {RelativeSource Mode = FindAncestor,AncestorType = UIElement}}”
>选项2:VerticalAlignment =“Stretch”
>选项3:高度=“自动”

提示:如果您是具有< RowDefinition Height =“*”>的Grid的子项,则使用VerticalAlignment =“Stretch”,如果不起作用,则使用Binding RelativeSource …其他地方.

但是,如果父控件具有无限高度呢?

如果父控件具有无限高度,那么我们就会遇到更大的问题.我们必须继续设置每个连续父级的高度,直到我们使用非无限的ActualHeight命中控件.

附录A:相关文章

> How to make scrollviewer work with Height set to Auto in WPF?
> DevExpress: InfiniteGridSizeException was unhandled.
> DevExpress: Grid throws InfiniteGridSizeException when in stackpanel.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读