本文介绍了是否有任何类似于vb datagridview的datagridview属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好, 我有一个表单,该表单中存在一个datagridview. 我正在使用C#语言. 我想这样做,当我单击该datagridview控件的任何行时,应该在消息框中弹出与所选行相关的第二列数据. 我该怎么办 请帮助..........
Hello, I have a form ,in that form one datagridview is present. I am using C# langauge. I want to do that, when i click any row of that datagridview control,the second column''s data related to selected row should pop-up in Message Box. how can i do this please help..........
推荐答案处理DataGridView.Click事件: Handle the DataGridView.Click event: private void myDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { DataGridView dgv = sender as DataGridView; if (dgv != null) { DataGridViewCell cell = dgv.Rows[e.RowIndex].Cells[e.ColumnIndex]; MessageBox.Show(cell.Value.ToString()); } }
更多推荐
是否有任何类似于vb.net datagridview的datagridview属性?
发布评论