Answer: Set AutoGenerateColumns to True. If we do not have columns i.e. TemplateField inside Gridview.In that case,we have to set AutoGenerateColumns property to True.By-default it's false.
For ex:-
<asp:GridView ID="grid_view_employee_details" AutoGenerateColumns = "True" runat="server" AllowPaging="true" PageSize="10">
</asp:GridView>
Whatever columns are there in the Select statement will bind in Gridview.
Asked In: Many Interviews |
Alert Moderator