如何为gridview内的标签赋值? [英] How to assign a value to a label inside a gridview?

查看:85
本文介绍了如何为gridview内的标签赋值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想基于(两个)按​​钮点击中的任何一个为网格视图内的标签指定一个值,即如果用户点击了应显示接受按钮已接受,如果单击拒绝按钮,则拒绝应显示在标签上。网格视图有一个名为STATUS的,标签和按钮放在该列内。







我该如何实现?请帮帮我。

Hi,

I want to assign a value to a label inside a grid view based on any of the (two) button click i.e. If a user clicks the "ACCEPT" button, "accepted" should be displayed and if "REJECT" button is clicked,"rejected" should be displayed to the label. The grid view has a column named STATUS and the label and the buttons are placed inside that column.



How can i implement that? Please help me.

推荐答案

请检查dataGridView_CellEnter或dataGridView_EditingControlShowing事件。当你点击任何一个单元格时,这些事件会被激发,一旦你能够捕获这些事件,你可以写下你可以改变标签的逻辑
Please check for dataGridView_CellEnter or dataGridView_EditingControlShowing event. when ever you click on any cell these event get fires, Once you able to capture these events you can than write your logic where you can change the label


这篇关于如何为gridview内的标签赋值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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