Click here to Skip to main content
15,909,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,

I am using the gridview to bind the data.I used common field for edit,update and bound field for column headers. I have inserted values into grid view. But my question is where we use the template field in grid view.

Here is a sample code
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            
            onrowcancelingedit="GridView1_RowCancelingEdit" 
            onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
            onrowupdating="GridView1_RowUpdating">
            <columns>
              <asp:CommandField HeaderText="Edit-Update" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" />
                <asp:BoundField DataField="NAME" HeaderText="NAME" />
                <asp:BoundField DataField="AGE" HeaderText="AGE" />
                <asp:BoundField DataField="PLACEOFBIRTH" HeaderText="PLACEOFBIRTH" />
                <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />


            </columns>
Posted
Updated 17-Feb-11 1:54am
v2

1 solution

Well below is quick tutorial for the same:

http://msdn.microsoft.com/en-us/library/bb288032.aspx[^]
 
Share this answer
 

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