Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a datagridview with 3 collumns and the value of each collumns from a database. i want in collumn 3 is in button shape with the text of button is from database. please help and tell me if you can solve this problem. Sorry for my bad in english language. Thanks.
Posted
Comments
Ranjan.D 24-Oct-13 14:16pm    
Have a look into - http://stackoverflow.com/questions/6085930/add-button-column-in-a-databound-datagridview
Endy Sarwa 24-Oct-13 14:40pm    
thanks for your link, but that is not what i want. on that link just add button. i already know to do that. my problem is i want the value of the columns become text of the button.
example, 3 columns with value (id, pass, true) i want that last column become button with text is same with the value of the last columns
Ranjan.D 24-Oct-13 14:42pm    
Looks like you need to handle Gridview DataRow bound event and alter button text.
Endy Sarwa 24-Oct-13 14:52pm    
can you explain more? or you can show me the example code?
actually i want the text of button in datagrid will be different each row, depend on the value of the last columns.
Ranjan.D 24-Oct-13 14:56pm    
http://social.msdn.microsoft.com/Forums/windows/en-US/48fe52e4-0ae6-486e-9b88-4324e59415ee/datagridview-row-data-bound-event?forum=winformsdatacontrols

1 solution

Make use of the DataGridViewButton[^] column.
This has a Text property where you can set the text.
 
Share this answer
 
Comments
Endy Sarwa 24-Oct-13 14:40pm    
thanks for your response. can u explain more? i dont get it.
Sergey Alexandrovich Kryukov 24-Oct-13 20:24pm    
Enough said :-), a 5.
—SA
Abhinav S 24-Oct-13 23:30pm    
Thank you SA.

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