开发者

C# disable datagrid scrolling

开发者 https://www.devze.com 2022-12-12 07:55 出处:网络
Is is possible to 开发者_开发百科disable DataGrid scrolling ? If yes, how ? Thanks.In your wpf datagrid set the datagrid property as

Is is possible to 开发者_开发百科disable DataGrid scrolling ? If yes, how ?

Thanks.


In your wpf datagrid set the datagrid property as

    <DataGrid Name="mydatagrid" HorizontalScrollBarVisibility="Disabled 
            "VerticalScrollBarVisibility="Disabled" />


You can disable the scrolling using the following properties:

ScrollViewer.CanContentScroll="False"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Disabled"

However in some cases (such as one I'm stuck with now); when you disable scrolling, using the scroll-wheel over the grid won't work in the more higher FrameworkElements.

0

精彩评论

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