参考如下:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q480q
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q480q
解决方案 »
- WinForm Show事件
- 解決了這個問題,我會愛死恩.
- 如何实现 点击Form1的 button1 响应 Form2的 button2的事件
- vs2003开发的web系统,转用vs2005的问题
- winform程序 在用代理服务器的局域网中发邮件 问题
- Winform下子窗口最大化,布局的问题,请高手帮忙一起解决,谢谢!
- *.pfx文件问题
- 急!急!急救啊,vs.net2005直接打印水晶报表的例子
- 怎样在多个Web projects中共用一个Session中的值?
- 连接数据库的连接字的问题,比较菜!
- 如何统计DataTable中某一列的不重复的值
- 我的超连接在ie5.0下不能用,急,立马给分
由于和checkbox控件绑定的那个DataItem(在DataGrid中的DataItem)的值在某botton点击后需要改变
并提交数据库 更新
以便下一次检索数据的时候 出现的是改变后的数据
要怎么做呢?
这个问题回答后一样有分 不够再加!多谢大家了!
checkbox cb=(checkbox)DataGird.Item[i].cell[j];
if(cb.checked)
then………………把id传给谁?再怎么找到那行某列?
教教我吧 感激不尽!
private void Button1_Click(object sender, System.EventArgs e)
{
CheckBox chkSelected;
string updatetext;
for(int i=0; i<DataGrid1.Items.Count; i++)
{
DataGridItem myDataGridItem=DataGrid1.Items[i];
chkSelected=(CheckBox)myDataGridItem.FindControl("CheckBox1");
if(chkSelected.Checked)
{
Label labelid=(Label)myDataGridItem.FindControl("Label2");
string strid=labelid.Text;//棒定的ID
updatetext="delete from catalog_knowledgepoint where knowledgepointcode='"+strid+"'";//这里写你要处理的语句
SqlConnection sqlstr=new SqlConnection("Persist Security Info=False; trusted_connection=false;database=cwyk;data source=AIWENZX\\NETSDK;uid=sa;pwd='';");
SqlCommand mycommand= new SqlCommand (updatetext,sqlstr);
mycommand.Connection .Open();
mycommand.ExecuteNonQuery();
mycommand.Connection.Close();
mycommand.Dispose();
}
}
BindGrid();//刷新DATAGRID
}