在datagrid中放入一个dropDownList(忘了这个问题在那里看到的了CSDN or Th
2024-07-21 02:16:52
供稿:网友
其实很简单,只要将这一类的东东都放到 <edititemtemplate>里就行了
<edititemtemplate>
<asp:dropdownlist id="cmbcategories" runat="server"></asp:dropdownlist>
</edititemtemplate>
就可以在cs中操作它了,填充数据,等等等等
<asp:datagrid id="dgproducts" runat="server" autogeneratecolumns="false" datakeyfield="productid" cellpadding="4" borderwidth="1px" bordercolor="#dedfde" backcolor="white" borderstyle="none" gridlines="vertical" forecolor="black">
<selecteditemstyle font-bold="true" forecolor="white" backcolor="#ce5d5a"></selecteditemstyle>
<alternatingitemstyle borderstyle="double" bordercolor="#0000c0" backcolor="white"></alternatingitemstyle>
<itemstyle cssclass="header" backcolor="#f7f7de"></itemstyle>
<headerstyle font-bold="true" forecolor="white" backcolor="#6b696b"></headerstyle>
<footerstyle backcolor="#cccc99"></footerstyle>
<columns>
<asp:boundcolumn datafield="productname" headertext="name"></asp:boundcolumn>
<asp:templatecolumn headertext="category">
<itemtemplate>
<%# container.dataitem("categoryname")%>
</itemtemplate>
<edititemtemplate>
<asp:dropdownlist id="cmbcategories" runat="server"></asp:dropdownlist>
</edititemtemplate>
</asp:templatecolumn>
<asp:editcommandcolumn buttontype="pushbutton" updatetext="update" canceltext="cancel" edittext="edit"></asp:editcommandcolumn>
</columns>
</asp:datagrid>网站运营seo文章大全提供全面的站长运营经验及seo技术!