使用C#在DataGridView中的SelectionChanged事件的目的是什么? [英] purpose of SelectionChanged event in the DataGridView using C#?

查看:950
本文介绍了使用C#在DataGridView中的SelectionChanged事件的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用C#在DataGridView中的SelectionChanged事件的目的是什么?

What is the purpose of SelectionChanged event in the DataGridView using C# ?

推荐答案

如果行选择为"on",则该事件将帮助您识别选定的行.并允许您对事件执行一些操作.
if row selection is "on", the event will help you identify the selected row. and will allow you to perform some operations on the event.


当用户在datagridview中留下一行时,它允许您进行一些处理.只需说您在dgv中有一个总列即可作为其他列值的总和,那么当用户完成其他列的编辑并离开该行时,您可以使用该事件来总计已编辑列,并在总列中填充结果.

看看 MSDN文档 [ ^ ] .他们有一个很好的样本.

希望对您有帮助
It allows you to do some processing when a user leaves a row in the datagridview. Just say you had a total column in the dgv that was the sumn of other column values, then when the user is finished editing the othercolumns and leaves the row, you can use that event to total the edited columns, and populate the total column with the result.

Haave a look at the MSDN docs[^] for this event. They have a good sample.

Hope this helps


这篇关于使用C#在DataGridView中的SelectionChanged事件的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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