asp:GridView不可见. [英] asp:GridView not visible.

查看:91
本文介绍了asp:GridView不可见.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在ASP.Net中的第一个应用程序

asp:gridview在表单中不可见吗?
我做错了什么?

请告诉我.
SwaxRak
谢谢


This is my first application in ASP.Net

The asp:gridview is not visible in the form?
What i have made wrong?

Please advise me.
SwaxRak
Thanks


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Mobile Shop Cart</title>
</head>
<body>
    <form id="ShopCart" runat="server">
    <div>
        <asp:Label Text="List Of Available Items" runat="server"></asp:Label>
        <asp:GridView ID="Gridview1" runat="server">
            <Columns>
             <asp:CommandField ShowDeleteButton="true" ShowEditButton="true" />
             <asp:BoundField DataField ="ItemID" HeaderText ="Item ID" ReadOnly="true" />
             <asp:BoundField DataField ="ItemDescription" HeaderText ="Item Description" ReadOnly="true"/>
            </Columns>
        </asp:GridView>
        <asp:Button Text="Buy" runat="server" />
    </div>
    </form>
</body>
</html>

推荐答案

您是否将任何数据绑定到网格了?
Did you bind any data to the grid?


我会假定没有数据要显示在其中网格.在这种情况下,我认为GridView控件具有EmptyDataText属性或类似属性,但是您必须查找它才能获得详细信息.
I would assume there is no data to be displayed in the grid. I think the GridView control has an EmptyDataText property or similar for this scenario but you''d have to look it up to get the specifics.


您是否在代码隐藏中编写了代码?
首先将数据与列ItemID,ItemDescription绑定.
Have you written code in codebehind ?
first bind data with column ItemID, ItemDescription.


这篇关于asp:GridView不可见.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆