是否有任何类似于vb.net datagridview的datagridview属性?

编程入门 行业动态 更新时间:2024-10-25 10:31:46
本文介绍了是否有任何类似于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属性?

本文发布于:2023-11-06 21:25:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564710.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类似于   有任何   属性   vb   datagridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!