为什么这个网格没有出现在我的网页上?我正在用静态项目填充下拉列表,用户将填写文本框。我不需要进行数据绑定或拥有数据源(我不认为)。正确的?
我的目标是:在 ASP.NET Web 窗体中添加多行数据的最简单方法
<asp:GridView ID="gvPurchaseDetails" runat="server" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" AutoGenerateColumns="true">
<AlternatingRowStyle BackColor="Gainsboro" />
<Columns>
<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<asp:DropDownList runat="server">
<asp:ListItem Selected="True" Value="72594206916">Heart Pndnt Necklace (72594206916)</asp:ListItem>
<asp:ListItem Selected="True" Value="72594206916">Heart Pndnt Necklace (72594206916)</asp:ListItem>
<asp:ListItem Selected="True" Value="72594206916">Heart Pndnt Necklace (72594206916)</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox ID="txtQuantity" runat="server" Width="25px" MaxLength="2" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Purchase Date">
<ItemTemplate>
<asp:TextBox ID="txtPurchaseDate" runat="server" Width="25px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Purchase City">
<ItemTemplate>
<asp:TextBox ID="txtPurchaseCity" runat="server" Width="25px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Purchase State">
<ItemTemplate>
<asp:TextBox ID="txtPurchaseState" runat="server" Width="25px" MaxLength="2" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#0000A9" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#000065" />
</asp:GridView>