What property do we require to add within the Gridview tags to bind columns manually?

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

We have to set AutoGenerateColumns Property to false on the Gridview to bind columns manually.In such case,we have to write code inside TemplateField or BoundField.

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

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

<asp:BoundField HeaderText="Employee Name" DataField = "middle_name" NullDisplayText="Not Found" />

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response