我想在显示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>
</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>
DetailsView中的DropDownList和CheckBoxList如何动态添加项