View Code for Web/WebControls/MajorList.ascx

Source code for the file Web/WebControls/MajorList.ascx is shown below.

<%@ Control CodeBehind="MajorList.ascx.cs" Inherits="QuantumConcepts.CodeGenerator.Sample.Web.WebControls.MajorList" Language="C#" %>
<%@ Register TagPrefix="Common" TagName="PagedDataGrid" Src="~/WebControls/PagedDataGrid.ascx" %>

<Common:PagedDataGrid id="Grid" runat="server" OnNeedsDataBinding="Grid_NeedsDataBinding">
  <DataGrid DataKeyField="ID" AutoGenerateColumns="false" HeaderStyle-CssClass="Header" AlternatingItemStyle-CssClass="Alternate" OnItemCommand="Grid_ItemCommand">
    <Columns>
      <asp:BoundColumn HeaderText="ID" DataField="ID" HeaderStyle-Width="50px" ItemStyle-Width="50px" />
      <asp:BoundColumn HeaderText="Name" DataField="Name" />
      <asp:ButtonColumn Text="Edit" CommandName="Edit" ButtonType="LinkButton" HeaderStyle-CssClass="Action" ItemStyle-CssClass="Action" />
      <asp:ButtonColumn Text="Delete" CommandName="Delete" ButtonType="LinkButton" HeaderStyle-CssClass="Action" ItemStyle-CssClass="Action" />
    </Columns>
  </DataGrid>
</Common:PagedDataGrid>