Click here to Skip to main content
16,020,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
i want to change datagridviewbuttoncell text when click on in runtime

Code :

C#
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.
Posted
Updated 8-Mar-15 23:48pm
v2

1 solution

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#?[^].
 
Share this answer
 
Comments
bernova 9-Mar-15 9:53am    
Tanks . but i can't change button text in per row
You should be able to. The event is for DataGridView only.
bernova 9-Mar-15 10:47am    
Dear Tadit Dash,
your solution don't work , because i want change button text per in row that i click , not all rows.
Is that event changes text of all the button when being executed? Have you debugged?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900