Header Ads

Grid view with template columns


<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" AutoGenerateDeleteButton="True" 
            AutoGenerateEditButton="True" 
            onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
            onrowupdating="GridView1_RowUpdating" OnRowCancelingEdit="GridView1_RowCancelingEdit"  
           PageSize="3" onpageindexchanging="GridView1_PageIndexChanging" > 
            < Columns > 
                
               
                 < asp:TemplateField HeaderText="EmployeeNo" > 
                < ItemTemplate > 
                < %#Eval("EmployeeNo")% > 
                < /ItemTemplate > 
                < EditItemTemplate  > 
                < asp:TextBox ID="txtEmployeeNo" runat="server" Text=' < %#Eval("EmployeeNo")% > ' > < /asp:TextBox > 
                < /EditItemTemplate > 
                < /asp:TemplateField > 
                
                < asp:TemplateField HeaderText="Name" > 
                < ItemTemplate > 
                < %#Eval("Name")% > 
                < /ItemTemplate > 
                < EditItemTemplate  > 
                < asp:TextBox ID="txtName" runat="server" Text=' < %#Eval("Name")% > ' > < /asp:TextBox > 
                < /EditItemTemplate > 
                < /asp:TemplateField > 
                
                 < asp:TemplateField HeaderText="Email" > 
                < ItemTemplate > 
                < %#Eval("Email")% > 
                < /ItemTemplate > 
                < EditItemTemplate  > 
                < asp:TextBox ID="txtEmail" runat="server" Text=' < %#Eval("Email")% > ' > < /asp:TextBox > 
                < /EditItemTemplate > 
                < /asp:TemplateField > 
                              
            < /Columns > 
        < /asp:GridView >

No comments:



Powered by Blogger.