How to show data in itemtemplate in gridview in asp.net by linq

It’s simple. First you need to add gridview with itemtemplate item. Then  you can add additional code to display data into item which are given below

<asp:TemplateField HeaderText=”Id” HeaderStyle-HorizontalAlign=”Center”>
 <ItemTemplate>
 <asp:Label ID=”lblid” runat=”server”  Text='<%# Bind(“Id”)%>’></asp:Label>
 </ItemTemplate>                                                                                                   
   <HeaderStyle HorizontalAlign=”Center”></HeaderStyle>                                    <ItemStyle HorizontalAlign=”Center” VerticalAlign=”Middle” Width=”300px” />
   </asp:TemplateField>

Advertisements

1 thought on “How to show data in itemtemplate in gridview in asp.net by linq”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s