dataGridView1_SelectionChanged问题 [英] problem with dataGridView1_SelectionChanged

查看:62
本文介绍了dataGridView1_SelectionChanged问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

当您单击数据网格(Windows窗体)中的一行时,我有一个用于填充文本框的用户控件.
我在表格加载中绑定了网格,但是当网格中没有任何项目时,会出现错误.
dataGridView_SelectionChanged中使用时如何禁用自动选择?

请帮帮我.
谢谢

Hi friends,

I have a user control for filling a text box when you click on a row in data grid (windows form).
I bind the grid in the form load, but when I have no items in my grid it gives an error.
How can I disable auto select when I use from dataGridView_SelectionChanged?

Please help me.
Thanks

推荐答案

使用object sender确定是否选择了任何行或单元格,并且仅在选择行或单元格时才填充文本框.
Use the object sender to determine if any row or cell is selected and only fill the text box when one is.


这篇关于dataGridView1_SelectionChanged问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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