How to Display the First and Last Names in a Single Column in Gridview?

 Posted by vishalneeraj-24503 on 1/14/2014 | Category: ASP.NET Interview questions | Views: 666 | Points: 40
Answer:

We can write code inside ItemTemplate as

<asp:GridView ID="grid_employee_details" runat="server">

<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lbl_employee_full_name" runat="server" Text='<%#eval("first_name") & " " & eval("last_name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response