When I develop ASP .NET Web Applications, I use the following code to show Update
and Cancel
buttons when a user clicks on Edit
button inside DataGridView Column.
<asp:EditCommandColumn EditText="Edit"
ButtonType="LinkButton"
UpdateText="Update"
CancelText="Cancel"
HeaderText="Update"/>
Is there any way to do it in Windows Forms? What I have planned to do now is I will add three DataGridViewButtonColumn
s Edit
, Update
and Cancel
. And on cell click event of DataGridView, Edit
column will be hidden and Update
and Cancel
Column will be displayed.
Another solution is to use DataGridViewLinkCell
and change the value of the column after clicking on the cell.
Example: Insert, Update & Delete Table from DataGridView in C#.Net
There are a lot of questions on SO asking about DataGridView Select/Insert/Update/Delete Commands. But I'd like to know which will be the suitable method to use in this situation. Any help will be very much appreciated.
I think you can do like this & perform operations as you want :