简体   繁体   English

单击按钮时允许用户添加行的C#datagridview

[英]c# datagridview when button click allow user to add rows

on form load I have set the property AllowUserToAddRows to false 在表单加载中,我已将属性AllowUserToAddRows设置为false

DGV_PatientSessions.AllowUserToAddRows = false;

and at run time there is a button that when cliecked will change the property AllowUserToAddRows to true 在运行时,有一个按钮,当单击该按钮时,会将属性AllowUserToAddRows更改为true

DGV_PatientSessions.AllowUserToAddRows = true;

but nothing happened anyone can help ? 但是没有任何事可以帮助吗?

check these settings 检查这些设置

  • How data is bounded in the DataGridView Is your datagrid readonly DataGridView中的数据如何绑定您的数据网格是否为只读

Also, can you post the reproducible code. 另外,您可以发布可复制的代码吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM