Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<asp:GridView ID="GvRegDtls" DataKeyNames="Pid" runat="server" AutoGenerateColumns="False"
OnRowEditing="GvRegDtls_OnRowEditing">
<Columns>
<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" />
</Columns>
</asp:GridView>

---------------

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.
Posted

1 solution

SQL
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
 
v2
Comments
Sergey Alexandrovich Kryukov 10-Aug-13 1:21am    
Who are you talking to? To yourself?
—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