.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

template field in gridview

Posted By: sridar1     Posted Date: February 17, 2011    Points:2   Category :ASP.Net

I have some doubt in grid view.plz rectify it.
In gridview we are using the command field for edit,update,delete and bound field for entering column headers.But my doubt is that where we use the template field like item template,edititem template.

Author: shankey             
Posted Date: February 17, 2011     Points: 5   


following will clear your doubt
<asp:GridView ID="dgv" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
CssClass="GridViewStyle" GridLines="None" Width="100%" OnRowDataBound="dgv_RowDataBound">
<asp:TemplateField HeaderText="Name">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<th align="left" width="60%">
<asp:Label runat="server" ID="Label1" Text='User Name'></asp:Label>
<th align="center" width="20%">
<asp:Label runat="server" ID="Label2" Text='Is Male?'></asp:Label>
<th align="center" width="20%">
<asp:Label runat="server" ID="Label3" Text='Is Active?'></asp:Label>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td align="left" width="60%">
<asp:Label runat="server" ID="lbluser" ></asp:Label>
<td align="center" width="20%">
<asp:CheckBox runat="server" ID="chk"></asp:CheckBox>
<td align="center" width="20%">
<asp:Image runat="server" ID="imgCtrl" />
<RowStyle CssClass="RowStyle" />
<EmptyDataRowStyle CssClass="EmptyRowStyle" />
<PagerStyle CssClass="PagerStyle" />
<SelectedRowStyle CssClass="SelectedRowStyle" />
<HeaderStyle CssClass="HeaderStyle" />
<EditRowStyle CssClass="EditRowStyle" />
<AlternatingRowStyle CssClass="AltRowStyle" />


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend