把DataGrid1的绑定放在
if not ispostback then
....
end if
中
if not ispostback then
....
end if
中
解决方案 »
- 求一个实例,将GridView中数据导入到Excel表中(在线等)
- 求助!!!如何解决“应用程序中的服务器错误GridView--“GridView1”激发了未处理的事件“RowUpdating”"?
- 用图片做submit验证表单没有反映
- 三层架构是不是MVC的一种表现形式~
- 使用membership的后台管理应该怎么做
- 大家快帮一下呀,
- DataGrid的修改、删除按钮,点击没有反应! 高手们看看,有代码贴出! 谢谢!
- 问一个比较初级的问题:为什么添加了引用,还要在cs文件里使用using呢?
- 动态sql,急!
- yohomonkey,xhan2000,Lostinet,policy2008,请到此领分
- 如果我要统计所有绑定在datagrid的用户工资的总和,应该如何写代码?
- 请问有关编写系统日至的设计模式。
删除这句话
chbox=(CheckBox)myitem.FindControl ("checkbox");这句话没错的
确认你要的CheckBox的ID是否为checkbox
If(!Pages.IsPostBack)
{}
中
If(!Pages.IsPostBack)
{
//数据绑定
}
CheckBox chbox=new CheckBox ();
foreach(DataGridItem myitem in this.DataGrid1.Items )
{
CheckBox chbox=(CheckBox)i.FindControl ("CheckBox1");
chbox=(CheckBox)myitem.FindControl ("CheckBox1");
??为何选择了还是false if (chbox.Checked)
{
int nEmpID=(int)myitem.ItemIndex +1;
string con1="server=localhost;database=database;uid=sa;pwd=";
string sql="select * from TABLE1 where id ="+nEmpID;
SqlConnection mycon=new SqlConnection (con1);
SqlDataAdapter mycom=new SqlDataAdapter (sql,mycon);
mycon.Open ();
DataSet da=new DataSet ();
mycom.Fill (da,"taa");
DataGrid1.DataSource =da.Tables ["taa"].DefaultView ;
DataGrid1.DataBind ();
mycon.Close ();
break; }
}
}
TO:sgsh51()
我那句是多余的,谢谢,