试试:
cb=(HtmlInputCheckBox)this.table_workplan .Rows[i].Cells[0].Controls(0);为何不用Web控件:DataGrid
然后用模版列就可以达到你要的效果
cb=(HtmlInputCheckBox)this.table_workplan .Rows[i].Cells[0].Controls(0);为何不用Web控件:DataGrid
然后用模版列就可以达到你要的效果
解决方案 »
- 如何动态设置GridView单元格背景颜色
- javascript 删除不了gridview行
- Gridview中获取数据
- 倒计时label控件
- 急!!求各位高手,怎样在.net中后台获得分辨率??
- 请问一个事件连用两个AJAX行不?
- 那里有网上购物系统的源代码?IBUYSBUY我下载了,还有没有微软其它的例子?
- 急!!!!!菜鸟问题,请进,谢谢!!!!
- 怎样一次下载多个文件?
- 标识符可以是动态的吗?
- 使用owc将数据导入到excel文件出错的问题?求一个将数据导出到excel文件的源码
- 请问:4位16进制的Unicode值(例如'\u0041'),和16进制数('\x0041'),有什么区别?
{
// Put user code to initialize the page here
for(int i=0;i<10;i++)
{
HtmlTableRow myRow=new HtmlTableRow ();
HtmlTableCell myCell_0=new HtmlTableCell ();
HtmlTableCell myCell_1=new HtmlTableCell ();
CheckBox box=new CheckBox();
box.Text="复选框";
box.ID="Check" + i;
myCell_0.Controls.Add(box);
myRow.Cells.Insert (0,myCell_0);
myRow.Cells.Insert (1,myCell_1);
this.Table1.Rows.Insert ((i+1),myRow);
this.Table1.Rows[i+1].Cells[1].InnerText=i.ToString();
}}
private void Button1_Click(object sender, System.EventArgs e)
{
TextBox1.Text = "";
for(int i=0 ;i<10 ;i++)
{
CheckBox cb=this.Table1.Rows[i+1].Cells[0].FindControl("Check"+i) as CheckBox;
if(cb.Checked ==true)
{
TextBox1.Text +=this.Table1.Rows[i+1].Cells[1].InnerText.ToString() +"-";
}
}
}
http://msdn.microsoft.com/library/en-us/dndive/html/data05242001.asp?frame=true用datagrid 来做
for(int i=0;i<10;i++)
{
HtmlTableRow myRow=new HtmlTableRow ();
HtmlTableCell myCell_0=new HtmlTableCell ();
HtmlTableCell myCell_1=new HtmlTableCell ();
CheckBox box=new CheckBox();
box.Text="复选框";
box.ID="Check";
myCell_0.Controls.Add(box);
myRow.Cells.Insert (0,myCell_0);
myRow.Cells.Insert (1,myCell_1);
this.table_workplan .Rows .Insert ((i+1),myRow);
this.table_workplan Rows[i+1] .Cell[1].InnerText=i.Tostring();
}