Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<asp:GridView ID="GvRegDtls" DataKeyNames="Pid" runat="server" AutoGenerateColumns="False"
<asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" />

<asp:CommandField ButtonType="Button" HeaderText="Edit" EditText="" CancelText=""
DeleteText="" InsertText="" InsertVisible="False" NewText="" SelectText=""
ShowCancelButton="False" UpdateText="" ShowEditButton="True" />


in the above gridview , if i give name for command field's -- EditText , then if this commandfield( and normal button outside the grid is clicked),which triggers edit button(commandfield) to hide and automatically renders update & cancel button in that place. I don't require these button but i want to name the Command field button as Edit.

1 solution

In save button click event add line

gvFinancialdtls.EditIndex = -1; //Turn the Grid to read only mode

        BindGridView(); // Rebind GridView to reflect changes made
Share this answer
Sergey Alexandrovich Kryukov 10-Aug-13 1:21am    
Who are you talking to? To yourself?

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