在datagrid中放入一个DropDownList(忘了这个问题在那里看到的了CSDN or Th

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
其实很简单,只要将这一类的东东都放到    <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:da
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: .net
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭