CheckedListBox 怎么全部勾上?? foreach( ListItem cb in CheckBoxList1.Items){ cb.Selected = true;} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ListItem ?属于哪个命名空间的?我怎么找不到? for(int i=0;i<CheckBoxList1.Items.Count;i++) { CheckBoxList1.Items[i].Selected=true; } 前台用datagrid的摸板列<asp:datagrid id="mydatagrid" Runat="server" Width="775px" AlternatingItemStyle-VerticalAlign="Middle" DataKeyField="lend_id" AutoGenerateColumns="False" CellPadding="3" BackColor="White" BorderWidth="2px" GridLines="None" CellSpacing="1" BorderStyle="Ridge" BorderColor="White" AllowSorting="True"><asp:TemplateColumn HeaderText="是否提交"> <columns> <ItemStyle HorizontalAlign="Center"></ItemStyle> <ItemTemplate> <asp:CheckBox id="Chx" Runat="server"></asp:CheckBox> </ItemTemplate> <FooterStyle HorizontalAlign="Center"></FooterStyle> <EditItemTemplate> <asp:CheckBox id="chx" Runat="server"></asp:CheckBox> </EditItemTemplate> </asp:TemplateColumn>然后加一个按钮,作用当点击后,全部选种在.vb或.cs文件中,在这个按钮的点击时间中将摸半列中的check全部选种 “ListItem ?属于哪个命名空间的?我怎么找不到?”你要查帮助呀。是System.Web.UI.WebControls 命名空间的。 朋友,别听楼上的那些哥们的,他们都在逗你玩。只要这样就可以:for(int i=0;i<CheckBoxList1.Items.Count;i++){ CheckBoxList1.Items[i].Selected;}在数据加载到 CheckBoxList1 以后使用。 谢谢大家了!我用的是window控件C#,Items[i].Selected;也是不行的。我用下面这个了,可以。CheckBoxList1.SetItemChecked(i,true) 根本就没有这个属性CheckBoxList1.Items[i].Selected; 应该这样winformfor(int i=0;i<checkedListBox1.Items.Count;i++) { checkedListBox1.SetItemChecked (i,true); } CheckBoxList1.Items[i].Selected;这是那个猪在蒙人 请高手指点C# new Process出异常 关于 C# 数据列表显示的问题。 Can U do me a favor? 入门级问题 谢谢 毕业设计 VS2010下C#连接SQL Sever2008错误。错误40 江湖救急~ 各位大侠 关于foreach.................... DEV中lookupedit的问题 mdiform焦点问题 各位朋友,有哪位用VS.NET2003中的發開手機的系統!!UP者有分 new Excel.Application() 出错 ?????一个项目多少钱?????
{
CheckBoxList1.Items[i].Selected=true;
}
DataKeyField="lend_id" AutoGenerateColumns="False" CellPadding="3" BackColor="White" BorderWidth="2px"
GridLines="None" CellSpacing="1" BorderStyle="Ridge" BorderColor="White" AllowSorting="True">
<asp:TemplateColumn HeaderText="是否提交">
<columns> <ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="Chx" Runat="server"></asp:CheckBox>
</ItemTemplate>
<FooterStyle HorizontalAlign="Center"></FooterStyle>
<EditItemTemplate>
<asp:CheckBox id="chx" Runat="server"></asp:CheckBox>
</EditItemTemplate>
</asp:TemplateColumn>
然后加一个按钮,作用当点击后,全部选种
在.vb或.cs文件中,在这个按钮的点击时间中
将摸半列中的check全部选种
你要查帮助呀。
是System.Web.UI.WebControls 命名空间的。
只要这样就可以:for(int i=0;i<CheckBoxList1.Items.Count;i++)
{
CheckBoxList1.Items[i].Selected;
}在数据加载到 CheckBoxList1 以后使用。
我用的是window控件C#,
Items[i].Selected;也是不行的。
我用下面这个了,可以。
CheckBoxList1.SetItemChecked(i,true)
CheckBoxList1.Items[i].Selected;
for(int i=0;i<checkedListBox1.Items.Count;i++)
{
checkedListBox1.SetItemChecked (i,true);
}