标题:DetailsView中的DropDownList和CheckBoxList如何动态添加项
只看楼主
ldz0812
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-5-13
 问题点数:0 回复次数:0 
DetailsView中的DropDownList和CheckBoxList如何动态添加项

我想在显示DetailsViewRole控件时,DetailsViewRole控件中的chkRoleFlag的控件能自动添加一些项(如新闻管理、系统管理等),请各位大侠指点一下!谢谢!


<asp:DetailsView ID="DetailsViewRole" runat="server" AutoGenerateRows="False" BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"
GridLines="None" Width="230px" DefaultMode="Edit">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<EditRowStyle BackColor="#C0C0FF" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<Fields>
<asp:TemplateField HeaderText="ID">
<EditItemTemplate>
<asp:Label ID="lblRoleEditID" runat="server" Text='<%# Bind("roleID") %>'></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
&nbsp;
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("roleID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="角色名称">
<EditItemTemplate>
<asp:TextBox ID="txtRoleName" runat="server" Text='<%# Bind("roleName") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("roleName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="角色权限">
<EditItemTemplate>
<asp:CheckBoxList ID="chkRoleFlag" runat="server">
</asp:CheckBoxList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("flag") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="角色权限值">
<EditItemTemplate>
<asp:TextBox ID="txtRoleFlagID" runat="server" Text='<%# Bind("flagID") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("flagID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="操作">
<EditItemTemplate>
<asp:Button ID="btnRoleUpdate" runat="server" CommandName="Update" CssClass="ButtonCss"
Text="更新" Width="40px" />
<asp:Button ID="btnRoleCancel" runat="server" CssClass="ButtonCss" Text="取消" Width="40px" />
</EditItemTemplate>
</asp:TemplateField>
</Fields>
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
</asp:DetailsView>

搜索更多相关主题的帖子: CheckBoxList DetailsView DropDownList 动态 
2006-12-14 09:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-109373-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.229970 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved