protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { User_WorkUnitFactory.Delete(theCompanyCode, e.Values["USER_ID"].ToString(), e.Values["WORKUNIT_CODE"].ToString()); setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { //新增 int indexUser, indexUnit; ASPxGridLookup gridLookupUser = ASPxGridView1.FindEditFormTemplateControl("GridLookupUser") as ASPxGridLookup; ASPxGridLookup gridLookupRole = ASPxGridView1.FindEditFormTemplateControl("GridLookupRole") as ASPxGridLookup; List <object> Users = gridLookupUser.GridView.GetSelectedFieldValues("USER_ID"); List <object> WorkUnits = gridLookupRole.GridView.GetSelectedFieldValues("RMES_ID"); for (indexUser = 0; indexUser < Users.Count; indexUser++) { for (indexUnit = 0; indexUnit < WorkUnits.Count; indexUnit++) { User_WorkUnitFactory.Insert(theCompanyCode, Users[indexUser] as string, WorkUnits[indexUnit] as string); } } setCondition(); e.Cancel = true; ASPxGridView1.CancelEdit(); }