今天在用WPF开发时,调用DevExpress的GridControl。测试时正常,但最后转到所需要的框架出了问题,报错如下:
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, place the grid into a container that will give a finite height to the grid, or 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.
我的英语也是个半罐水,翻译后才知道。是页面的Grid的Height为星号或者Atuo时,就会报这个错!
网上查的资料都说得。。。。。不说了伤心。
现在我用最简单的方法:
直接把GridControl.View下添加一个MaxHeight就行了
<dxg:GridControl.View>
<dxg:TableView AllowPerPixelScrolling="True" ShowTotalSummary="True" ShowGroupPanel="False" GroupSummaryDisplayMode="AlignByColumns" AllowColumnFiltering="False" AllowResizing="True" MaxHeight="600"/>
</dxg:GridControl.View>
这个MaxHeight根据自己的实际情况添加