DataGrid.CanUserAddRows 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示用户是否可以向该 DataGrid行添加新行。
public:
property bool CanUserAddRows { bool get(); void set(bool value); };
public bool CanUserAddRows { get; set; }
member this.CanUserAddRows : bool with get, set
Public Property CanUserAddRows As Boolean
属性值
true 如果用户可以添加新行,则为否则,为 false. 已注册的默认值为 true。 有关影响值的内容的详细信息,请参阅 DependencyProperty。
注解
当此属性设置为 true 空白行时,将显示在底部 DataGrid。 用户可以在空白行中输入新项。 添加新行会将项添加到 。ItemsSource 可以通过处理 InitializingNewItem 事件和以编程方式设置值来设置新项的默认值。