asp:GridView UI Databind

Backend CS File
------------------------------------------------------------------------------------------------------------------------------------------------------------

List<ActivationCodeRejected> activationCodeRejectedList = new ActivationCodeRejectedBLL().GetAllActivationCodeRejecteds();

            GridViewActivationCodeRejected.DataSource = activationCodeRejectedList;
            GridViewActivationCodeRejected.DataBind();

==========================================================================================
Front end .aspx Page
------------------------------------------------------------------------------------------------------------------------------------------------------------
 <asp:GridView ID="GridViewActivationCodeRejected" runat="server" AutoGenerateColumns="false"
        AllowPaging="false" GridLines="Both" SkinID="GridView" Visible="true">
        <Columns>
            <asp:TemplateField HeaderText="Activation Code Name">
                <ItemTemplate>
                    <asp:Literal ID="ActivationCodeName" runat="server" Text='<%# Bind("ActivationCodeName") %>'></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Service Plan SKU">
                <ItemTemplate>
                    <asp:Literal ID="ServicePlanSKU" runat="server" Text='<%# Bind("ServicePlanSKU") %>'></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Min Products No">
                <ItemTemplate>
                    <asp:Literal ID="MinProductsNo" runat="server" Text='<%# Bind("MinProductsNo") %>'></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Max Products No">
                <ItemTemplate>
                    <asp:Literal ID="MaxProductsNo" runat="server" Text='<%# Bind("MaxProductsNo") %>'></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Upload Date">
                <ItemTemplate>
                    <asp:Literal ID="UploadDate" runat="server" Text='<%# Bind("UploadDate") %>'></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

No comments:

Post a Comment