0
我试图无法在我的子项嵌套gridview上使用dropdownlist。我有我的asp.net 4 web应用程序后面的代码。 以下是我的gridview的代码。使用我的编辑和页脚模板中的数据库中的数据在GridView中填充下拉列表
<asp:TemplateField HeaderText="Status" SortExpression="Status">
<ItemTemplate><%# Eval("Status")%></ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownListStatus" runat="server">
</asp:DropDownList>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="DropDownListStatus" runat="server" >
</asp:DropDownList>
我正在使用SqlDataSource。下面是我删除了一些导致错误的代码后面的代码。
protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
//Check if this is our Blank Row being databound, if so make the row invisible
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (((DataRowView)e.Row.DataItem)["CertificateNo"].ToString() == String.Empty) e.Row.Visible = false;
}
}
我试图FindControl已为我的下拉列表,使用查询,并将其绑定到我的下拉列表,但我没有做这样简单的事情。