Which Gridview property should be enabled to bind column when there is no column created inside gridview?

 Posted by vishalneeraj-24503 on 12/6/2013 | Category: ASP.NET Interview questions | Views: 2059 | Points: 40

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">


Whatever columns are there in the Select statement will bind in Gridview.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response