更新datagridviewbuttoncell文本 [英] Update datagridviewbuttoncell text
本文介绍了更新datagridviewbuttoncell文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨所有
i想要在运行时单击时更改datagridviewbuttoncell文本
代码:
hi all
i want to change datagridviewbuttoncell text when click on in runtime
Code :
if(e.rowindex == 3) // this define datagridviewbutton
{
datagridview1.rows[e.rowindex].cells["new_pay_ghest"].value = " pay ";
}
但文本在运行时没有改变。
but the text don't changed in runtime.
推荐答案
你正在改变单元格的文本不是按钮。您应首先在适当的事件中获取Button,然后尝试更改文本。
参考 - 我在datagridview中添加了更新按钮,当在c#中单击按钮时如何更改文本? [ ^ ]。
You are changing the text of the cell not button. You should first get the Button inside the appropriate event and then try to change the text.
Refer - i have added update button inside datagridview how to change text on it when button is clicked in c#?[^].
这篇关于更新datagridviewbuttoncell文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文