如何防止垂直滚动数据网格(不是数据网格视图) [英] How to prevent datagrid(not a datagrid view) from vertical scrolling

查看:48
本文介绍了如何防止垂直滚动数据网格(不是数据网格视图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含12行的dataGrid(不是datagridview)。最后一行是部分可见的。当我单击最后一行时,datagrid行向上滚动,最后一行之后添加一行。但我想要的是行不应该滚动,并且不应该有任何新行添加到最后一行,即状态datagrid行位置应该保持不变。我有用VB.Net 2010编写的应用程序& sql server 2008.

你会很高兴指导我找到问题的解决方案。



我有什么尝试过:



1. datagrid.readonly = True;不起作用

2.没有冻结数据网格的选项。

I have a dataGrid (not a datagridview) with 12 rows. The last row is partially visible. When I click the last row the datagrid rows scroll up and one row is added after the last row.But what I want is that the rows should not scroll at all and there should not be any new row added to the last one ie the state of datagrid rows positions should remain the same.I have the application written in VB.Net 2010 & sql server 2008.
It would be nice of you to guide me to a solution for the problem.

What I have tried:

1. datagrid.readonly = True ;does not work
2. There no option to freeze the datagrid.

推荐答案

尝试 DataGrid.CanUserAddRows属性(System.Windows.Controls) [ ^ ]。
Try DataGrid.CanUserAddRows Property (System.Windows.Controls)[^].


这篇关于如何防止垂直滚动数据网格(不是数据网格视图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆