求助!!! 在datagrid中怎么样进行数据的编辑功能??主要是不知道这个函数怎么写public void MyDataGrid_Update(Object sender,DataGridCommandEventArgs e) { } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 首先把当前行的数据读出来,然后执行update的数据库操作 个你个例子,慢慢看:public void DoItemUpdate(Object sender, DataGridCommandEventArgs e) { //执行更新操作 int key = e.Item.ItemIndex; int LinkID=Int32.Parse(dgdLink.DataKeys[key].ToString()); int CID=Int32.Parse(((DropDownList)e.Item.FindControl("CarList")).SelectedItem.Value.ToString());//分类编号 string classname = ((TextBox)e.Item.Cells[1].Controls [1]).Text;//分类名 string LinkHttp = ((TextBox)e.Item.Cells[2].Controls [0]).Text;//分类名 int OrderID = Int32.Parse(((TextBox)e.Item.Cells[3].Controls [0]).Text.ToString());//分类名 Watch.Components.Link myLink = new Watch.Components.Link(); myLink.UpdateLink(LinkID,CID,classname,LinkHttp,OrderID); dgdLink.EditItemIndex = -1; BindGrid(ViewState["Action"].ToString()); } GridView能实现这样的功能吗?? 难问题!!!有那位大哥能做个多个选择框连动的可绑定数据库的控件吗?来者有分! DataGrid在编辑时,事件总丢,怎么回事?有解决办法吗? 通过ADO.Net修改access数据库的问题 跪求创建多主机头IIS站点技术资料 文件流信息问题!!!!!!!!高手请教!!!!!!!! 数据绑定 正则匹配问题 关于用户控件的问题 sql 問題,看大家有什麼好的方法(急!!!!!!!!!在線啊) js传控件名(在线) 如何关闭浏览器就中断ORACLE服务器端的会话?
public void DoItemUpdate(Object sender, DataGridCommandEventArgs e)
{
//执行更新操作
int key = e.Item.ItemIndex;
int LinkID=Int32.Parse(dgdLink.DataKeys[key].ToString());
int CID=Int32.Parse(((DropDownList)e.Item.FindControl("CarList")).SelectedItem.Value.ToString());//分类编号
string classname = ((TextBox)e.Item.Cells[1].Controls [1]).Text;//分类名
string LinkHttp = ((TextBox)e.Item.Cells[2].Controls [0]).Text;//分类名
int OrderID = Int32.Parse(((TextBox)e.Item.Cells[3].Controls [0]).Text.ToString());//分类名
Watch.Components.Link myLink = new Watch.Components.Link();
myLink.UpdateLink(LinkID,CID,classname,LinkHttp,OrderID);
dgdLink.EditItemIndex = -1;
BindGrid(ViewState["Action"].ToString());
}