日期:2014-05-17 浏览次数:20531 次
protected void GrvRepairMailbox_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//this.GrvRepairMailbox.Rows[e.RowIndex].Cells[7].Controls[0]
string ID = GrvRepairMailbox.DataKeys[e.RowIndex].Value.ToString();
//string IsVisted = ((TextBox)(GrvRepairMailbox.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim();
string IsVisted = ((DropDownList)(this.GrvRepairMailbox.Rows[e.RowIndex].FindControl("ddl1"))).SelectedValue.ToString().Trim();
string Isolved = ((TextBox)(GrvRepairMailbox.Rows[e.RowIndex].Cells[6].Controls[0])).Text.ToString().Trim();
string udpsql = "update EP_TblMailbox set IsVisted='" + IsVisted + "', Isolved='" + Isolved + "' where ID='" + ID + "'";
dataOperate.execSQL(udpsql);
GrvRepairMailbox.EditIndex = -1;
GrvRepairMailboxbindData();
}
protected void GrvRepairMailboxbindData()
{
string sql = "select * from EP_TblMailbox where SendToDepartment = '维修部'";
GrvRepairMailbox.DataSource = dataOperate.getDataset(sql, "EP_TblRepairMailbox");
GrvRepairMailbox.DataKeyNames = new string[] { "ID" };
GrvRepairMailbox.DataBind();
}
<asp:GridView ID="GrvRepairMailbox" runat="server" AutoGenerateColumns="False"
onselectedindexchanging="GrvRepairMailbox_SelectedIndexChanging"
onrowcancelingedit="GrvRepairMailbox_RowCancelingEdit"
onrowediting="GrvRepairMailbox_RowEditing"
onrowupdating="GrvRepairMailbox_RowUpdating">
<Columns>
<asp:BoundField DataField="ID" HeaderText="编号" />
<asp:BoundField DataField="SenderName" HeaderText="发布人" /&g