求救 http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=8ADE535F-AD40-4DE3-A962-A64B4FAF12C4 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 编辑按扭的事件。可以在DataGrid属性事件里添加。private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e){ DataGrid1.EditItemIndex=e.Item.ItemIndex; DataGrid1.DataBind(); }编辑好,关闭按扭的事件private void DataGrid1_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e){ DataGrid1.EditItemIndex=-1; DataGrid1.DataBind();}更新按扭的事件private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e){ //这里可写一些数据库的操作,更新数据。 //比如下面可以读取该行第三列文本框转换为int型的数据 int shangPID=Convert.ToInt32(((TextBox)e.Item.Cells[3].Controls[0]).Text); //下面就可以用数据库命令更新了。} 删除也差不多。protected void DataGrid1_Delete(Object sender, DataGridCommandEventArgs E) { row=e.Item.ItemIndex;//获得底几行 //这里添加删除代码 DataGrid1.DataBind();} 在datagrid的itemcommand事件种就可以实现了,不过你需要先给每一个button设置CommandNameprivate void dgrd_itemcommand(...){switch(e.commandname){case "btndelete":{...break;}case "btnupdate":{...break;}case "btncancel":{...break;}}} 图表控件,求解决办法,查过CSDN,没找到办法 关于Web.config中的 <appSettings/> 如何判断和区分gridview模版列 SharpDevelop运行ASP。NET项目时出错 时间问题~速度~下班前结帖~~~~~~~ ASP与ASP.net有联系吗? 求助 --- ASP 如何获得 数据表的字段名,----各位大虾帮忙啦!!!!!在线等待 帮忙看下这段代码! 在.NET的开发平台中为何不能使用ASP WEB 应用程序 crystal report入门级的问题 在WEB环境下如何打印datagrid中的内容? 日期控件
private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex=e.Item.ItemIndex;
DataGrid1.DataBind();
}
编辑好,关闭按扭的事件
private void DataGrid1_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex=-1;
DataGrid1.DataBind();
}
更新按扭的事件
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
//这里可写一些数据库的操作,更新数据。
//比如下面可以读取该行第三列文本框转换为int型的数据
int shangPID=Convert.ToInt32(((TextBox)e.Item.Cells[3].Controls[0]).Text);
//下面就可以用数据库命令更新了。
}
protected void DataGrid1_Delete(Object sender, DataGridCommandEventArgs E)
{
row=e.Item.ItemIndex;//获得底几行
//这里添加删除代码
DataGrid1.DataBind();
}
{
switch(e.commandname)
{
case "btndelete":
{
...
break;
}
case "btnupdate":
{
...
break;
}
case "btncancel":
{
...
break;
}
}
}