简体   繁体   English

通过单击datagridview自动增加列中的值

[英]Auto-increment an value inside a column by clicking on the datagridview

I was wondering if there's a way you can code that with every click on the datagridview a value of one of my columns in my database auto-increments it's value by one. 我想知道是否有一种方法可以编码,即每次在datagridview上单击时,数据库中我的其中一列的值就会自动增加一。

I was making an c# videostore application and every time someone clicks on a movie in my datagrid the value in it's column ''clicks'' raises by one. 我正在制作一个c#videostore应用程序,每次有人在我的数据网格中单击电影时,“ clicks”列中的值就会增加一。

As commented: MSND website 如评论: MSND网站

They show you how to add the event handler and then take the value you want and play with it. 他们向您展示了如何添加事件处理程序,然后获取所需的值并使用它。

Hope it helps. 希望能帮助到你。

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

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