欢迎光临
我们一直在努力

在datagrid中放入一个DropDownList(忘了这个问题在那里看到的了CSDN or There)-.NET教程,Asp.Net开发

建站超值云服务器,限时71元/月

其实很简单,只要将这一类的东东都放到    <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>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 在datagrid中放入一个DropDownList(忘了这个问题在那里看到的了CSDN or There)-.NET教程,Asp.Net开发
分享到: 更多 (0)

相关推荐

  • 暂无文章