ASP.NET网格视图不显示

时间:2011-10-05 18:07:18

标签: asp.net gridview

我已将网格视图从UltraWebGid更改为ASP.NET网格视图。

ASP.NET Grid View的代码如下:

<asp:Panel ID="pnlLicenseMaintainHistory" runat="server" CssClass="gridScroll" >
    <asp:GridView ID="gridLicenseMaintainHistory" runat="server" AllowPaging="false" AutoGenerateColumns="false"
        EmptyDataText="No Records Found" EnableViewState="True" Width="99%" >
        <Columns>
            <asp:TemplateField HeaderText="Select" >
                <ItemTemplate>
                    <asp:LinkButton runat="server" ID="linkButtonLicenseMaintainHistory" CommandArgument='<%# Eval("licensemaintain_hst_key")%>' Text="Select"
                        OnClick="lnkLicenseMaintainHistory_Click"></asp:LinkButton>
                </ItemTemplate>
                    <ItemStyle Width="6%" />
                </asp:TemplateField>
                <asp:BoundField HeaderText="License Type" DataField="license_info" HeaderStyle-CssClass="filterColumn">
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="License ID" DataField="license_id" HeaderStyle-CssClass="filterColumn">
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Issued Date" DataField="issued_dttm" DataFormatString="{0:MM/dd/yyyy}" HeaderStyle-CssClass="filterColumn" HtmlEncode="False">
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Effective Beg Date" DataField="effective_begin_dt" DataFormatString="{0:MM/dd/yyyy}" HeaderStyle-CssClass="filterColumn" HtmlEncode="False" >
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Effective End Date" DataField="effective_end_dt" DataFormatString="{0:MM/dd/yyyy}" HeaderStyle-CssClass="filterColumn" HtmlEncode="False" >
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Status" DataField="license_status" HeaderStyle-CssClass="filterColumn">
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Update By" DataField="updated_by" HeaderStyle-CssClass="filterColumn">
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Updated Date" DataField="updated_dttm" DataFormatString="{0:MM/dd/yyyy}" HeaderStyle-CssClass="filterColumn" HtmlEncode="False" >
                    <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField HeaderText="Record Type" DataField="record_type" HeaderStyle-CssClass="filterColumn">
                    <ItemStyle Width="10%" />
                </asp:BoundField>
        </Columns>
    </asp:GridView>
</asp:Panel>

但是当我转到我的应用程序时,Grid View没有显示出来。我的代码有什么问题?提前谢谢。

1 个答案:

答案 0 :(得分:0)

您缺少<asp:TemplateField HeaderText="Select">的结束标记。如果您正确格式化了标记,就会注意到这一点。