void treeList1_CellValueChanging(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { TreeList tl = sender as TreeList; DataRowView v = tl.GetDataRecordByNode(e.Node) as DataRowView; ChangeObject = v.Row[e.Column.FieldName]; }
/// <summary> /// 单元格编辑事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { DataRowView info = this.projectTrees1.treeList1.GetDataRecordByNode(e.Node) as DataRowView; if (info != null) { info["Name"] = e.Value.ToString(); info["NodeName"] = e.Value.ToString(); //info.StructSource.ModelProject.UpDate(info); //this.CurrentBusiness.Current.StructSource.ModelProject.UpDate(info); _UnitProject unit = info["UnitProject"] as _UnitProject; if (unit != null) { unit.Name = unit.NodeName = e.Value.ToString(); info["UnitProject"] = unit; } } ///如果是已经存在的数据 /*if (this.projectTrees1.SelectItem.ObjectState == EObjectState.UnChange) * { * //当前对象设置为修改状态 * this.projectTrees1.SelectItem.ObjectState = EObjectState.Modify; * } * this.projectTrees1.SelectItem.Property.Name = e.Value.ToString();*/ }
protected override void RaiseCellValueChanged(DevExpress.XtraTreeList.CellValueChangedEventArgs e) { base.RaiseCellValueChanged(e); //编辑结束 记录当前编辑的对象 //EditNode = e.Node; // EditColumn = e.Column; /*string str = string.Format("{0},{1}",e.Node.Id,e.Column.ColumnHandle); * if(!EditedObject.Contains(str)) * { * EditedObject.Add(str); * }*/ }
private void treeSolInterm_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { /* * Solidos * ------- * 1: Alicuota = volumen*concentracion/concentracion patron * * Líquidos * -------- * 1: Alicuota = volumen/(concentracion patron/concentracion) */ // Hacer el cálculo // Si es el patrón de solución es muestra terminal entonces verificar // antes si es sólido o líquido // try { if (e.Node.Level == 0) { // Muestra patron es terminal if (IsSolidSolutionPattern()) // sólido { e.Node["Aliquot"] = Convert.ToDecimal(e.Node["Volumen"]) * Convert.ToDecimal(e.Node["Concentration"]) / template_method_aa.Std_concentration; } else // líquido { e.Node["Aliquot"] = Convert.ToDecimal(e.Node["Volumen"]) / (template_method_aa.Std_concentration / Convert.ToDecimal(e.Node["Concentration"])); } tbAliquot.Value = Convert.ToInt32(e.Node["Aliquot"]); } else if (e.Node.Level >= 1) // solucion intermedia { // solución intermedia 1 o 2 es terminal // determinar la concentración decimal parentConcentration = Convert.ToDecimal(e.Node.ParentNode["Concentration"]); e.Node["Aliquot"] = Convert.ToDecimal(e.Node["Volumen"]) / Convert.ToDecimal(e.Node["Concentration"]) / parentConcentration; tbAliquot.Value = Convert.ToInt32(e.Node["Aliquot"]); } } catch (Exception ex) { ComunForm.Send_message("Soluciones", TypeMsg.error, ex.Message); } }
private void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { if (e.Column == this.tcName) { if (string.IsNullOrEmpty(e.Value.ToString().Trim())) { DXMessage.ShowTips("主体名称不能为空!"); return; } var id = Convert.ToInt32(e.Node.GetValue(tcId)); var name = e.Value.ToString().Trim(); var commandText = $@"UPDATE IndustryInfo SET Name = '{name}' WHERE Id = {id }"; SqlHelper.ExecuteNonQuery(AppConfig._ConnString, CommandType.Text, commandText); } }
void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { if (BeforeOnCellValueChanged != null) { BeforeOnCellValueChanged(this, null); } switch (e.Column.FieldName) { case "Calculation": //费率 case "Coefficient": //计算基础 case "Feature": //判断特项是否为空 if (e.Node["Feature"].ToString() != string.Empty) { Method.Calculate(); /*if (this.m_CUnitProject.Property.Metaanalysis.IsEdit) * { * this.m_CUnitProject.Property.Metaanalysis.Calculate(); * }*/ } break; } ModifyAttribute modity = new ModifyAttribute(); modity.CurrentValue = e.Value; modity.OriginalValue = ChangeObject; modity.ObjectName = e.Column.Caption; modity.ModelName = "汇总分析"; modity.Source = this.metaanalysisList1.treeList1.Current.Row; modity.FieldName = e.Column.FieldName; //modity.ActingOn = "清单.子目"; ChangeObject = null; this.LogContent.Add(modity); //LogContent.Add(e); GetContainer.ALogForm.Init(); if (AfterOnCellValueChanged != null) { AfterOnCellValueChanged(this, null); } }
private void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { // (sender as DevExpress.XtraTreeList.TreeList).EndCurrentEdit(); //tblWorkFlowTableAdapter.Update(dSWorkFlow.tblWorkFlow); DataRow[] rowUpdate = dSWorkFlow.tblWorkFlow.Select("ID = " + treeList1.FocusedNode.GetValue("ID").ToString()); string strProject = ""; int nID, nDepartment = 0; nID = System.Convert.ToInt32(treeList1.FocusedNode.GetValue("ID")); if (rowUpdate[0]["strProject"].ToString() != string.Empty) { strProject = rowUpdate[0]["strProject"].ToString(); } if (rowUpdate[0]["nDepartmentID"].ToString() != string.Empty) { nDepartment = System.Convert.ToInt32(rowUpdate[0]["nDepartmentID"]); } tblWorkFlowTableAdapter2.UpdateValue(strProject, nDepartment, rowUpdate[0]["strDetail"].ToString(), nID); }
/// <summary> /// 编辑菜单内容 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treelstFunction_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { string changId = treelstFunction.FocusedNode.GetValue("Gid").ToString(); xmlhelper = new XmlHelper(@"XML\function.xml"); var xmlNodes = xmlhelper.Read("datatype"); for (Int32 i = 0; i < xmlNodes.Count; i++) { if (string.Equals(xmlNodes[i].ChildNodes[0].InnerText, changId)) { Int32 idx = -1; switch (treelstFunction.FocusedColumn.FieldName) { case "Name": idx = 2; break; case "FunctionGid": idx = 3; break; case "SystemtypeId": idx = 4; break; case "Seq": idx = 5; break; } if (idx == -1) { break; } xmlNodes[i].ChildNodes[idx].InnerText = treelstFunction.FocusedNode.GetValue(treelstFunction.FocusedColumn.FieldName).ToString(); xmlhelper.Save(false); } } }
private void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { // if ((e.Value.ToString() != lastEditValue // || lastEditNode != e.Node // || lastEditColumn != e.Column) // //&& e.Column.FieldName.IndexOf("年") > 0 // //&& e.Column.Tag != null //) // { // if (e.Column.FieldName != "Lixi" && e.Column.FieldName != "Yubei" && e.Column.FieldName != "Dongtai" && e.Column.FieldName != "Dongtai") // { // SaveCellValue((int)treeList1.FocusedColumn.Tag, (int)treeList1.FocusedNode.GetValue("ID"), Convert.ToDouble(e.Value)); // } // else // { // int id = (int)e.Node["ID"]; // SaveCellValue(e.Column.FieldName, id, Convert.ToDouble(e.Value)); // } // // if (e.Column.FieldName == "Lengths" || e.Column.FieldName == "LCount" || e.Column.FieldName == "Total" || e.Column.FieldName == "Volume" || e.Column.FieldName == "Type" || e.Column.FieldName == "IsSum" || e.Column.FieldName == "ItSum") { SaveValue(e.Node["UID"].ToString(), e.Node["Lengths"].ToString(), e.Node["LCount"].ToString(), e.Node["Total"].ToString(), e.Node["Volume"].ToString(), e.Node["Type"].ToString(), e.Node["IsSum"].ToString(), e.Node["ItSum"].ToString()); CalculateSum(e.Node, e.Column); } //ItSum // //} // //else // //{ // // treeList1.FocusedNode.SetValue(treeList1.FocusedColumn.FieldName, lastEditValue); // //} // } // CalculateNodeSum(e.Node); }
private void OrderDetailListView_CellValueChanging(object sender, CellValueChangedEventArgs e) { if (e.Node == null) { return; } if (!(e.Node.GetValue("Key") is PostCardBasic postCardBasic)) { return; } //如果当前在份数选择那一列,返回,不进行后续操作 if (e.Column == postCardCountColumn) { return; } if (e.Column == paperNameColumn) { postCardBasic.PaperName = e.Value as string; } if (e.Column == doubleSideColumn) { if ((bool)e.Value) { postCardBasic.DoubleSide = true; //如果为明信片集合,更新明信片集合中的所有明信片 if (postCardBasic is EnvelopeInfo tmpEnvelopeInfo) { tmpEnvelopeInfo.PostCards.ForEach(postCard => postCard.DoubleSide = true); } } else { postCardBasic.DoubleSide = false; postCardBasic.BackStyle = null; //如果为明信片集合,更新明信片集合中的所有明信片 if (postCardBasic is EnvelopeInfo tmpEnvelopeInfo) { tmpEnvelopeInfo.PostCards.ForEach(postCard => { postCard.DoubleSide = false; postCard.BackStyle = null; }); } } } if (e.Column == backStyleColumn) { postCardBasic.BackStyle = e.Value as BackStyleInfo; } if (e.Column == productSizeColumn) { postCardBasic.ProductSize = e.Value as PostSize; } if (e.Column == frontStyleColumn) { postCardBasic.FrontStyle = e.Value as string; if (postCardBasic is EnvelopeInfo envelopeInfo) { envelopeInfo.PostCards.ForEach(postCard => postCard.FrontStyle = e.Value as string); } } if (e.Column == backStyleColumn) { postCardBasic.BackStyle = e.Value as BackStyleInfo; if (postCardBasic is EnvelopeInfo envelopeInfo) { envelopeInfo.PostCards.ForEach(postCard => postCard.BackStyle = e.Value as BackStyleInfo); } } orderDetailListView.RefreshDataSource(); }
private void OrderDetailListView_CellValueChanged(object sender, CellValueChangedEventArgs e) { orderDetailListView.RefreshDataSource(); RefreshSubmitEnvelopeList(); gridView2.RefreshData(); }
private void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { }
/// <summary> /// 编辑菜单内容 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treelstMenu_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { string changId = treelstMenu.FocusedNode.GetValue("Gid").ToString(); xmlhelper = new XmlHelper(@"XML\menu.xml"); var xmlNodes = xmlhelper.Read("datatype/dataitem"); for (Int32 i = 0; i < xmlNodes.Count; i++) { if (string.Equals(xmlNodes[i].ChildNodes[0].InnerText, changId)) { Int32 idx = -1; switch (treelstMenu.FocusedColumn.FieldName) { case "Name": idx = 2; break; case "Icon": idx = 3; break; case "Seq": idx = 4; break; case "AuthGid": idx = 5; break; case "IsVisable": idx = 6; break; case "WinformClass": idx = 7; break; case "Url": idx = 8; break; case "WebIcon": idx = 9; break; case "SystemtypeId": idx = 10; break; case "CreatorId": idx = 11; break; case "CreateTime": idx = 12; break; case "EditorId": idx = 13; break; case "LastUpdateTime": idx = 14; break; case "IsDelete": idx = 15; break; } if (idx == -1) { break; } if (idx == 15 || idx == 6) { xmlNodes[i].ChildNodes[idx].InnerText = Convert.ToBoolean(treelstMenu.FocusedNode.GetValue(treelstMenu.FocusedColumn.FieldName)) ? "1" : "0"; } else { xmlNodes[i].ChildNodes[idx].InnerText = treelstMenu.FocusedNode.GetValue(treelstMenu.FocusedColumn.FieldName).ToString(); } xmlhelper.Save(false); } } }
void ViewExplorer_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { MyData obj = (MyData)this.GetDataRecordByNode(this.FocusedNode); if (obj == null || obj.InnerData == null) { return; } String strNo = String.Empty; if (obj.InnerData is STViewsInfo) { strNo = (obj.InnerData as STViewsInfo).STViewNo; } if (obj.InnerData is STViewGroupsInfo) { strNo = (obj.InnerData as STViewGroupsInfo).No; } if (strNo == e.Value.ToString()) { this.OptionsBehavior.Editable = false; return; } if (obj.InnerData is STViewsInfo) { STViewsController viewCtrl = new STViewsController(); //if ( viewCtrl.GetObjectByNo( e.Value.ToString() )!=null ) //{ // ABCHelper.ABCMessageBox.Show( String.Format( "View Name : '{0}' is already existed. " , e.Value.ToString() ) , "Message" , MessageBoxButtons.OK , MessageBoxIcon.Error ); // e.Value=strNo; // this.OptionsBehavior.Editable=false; // return; //} STViewsInfo info = (STViewsInfo)obj.InnerData; if (info != null) { info.STViewNo = e.Value.ToString(); info.STViewName = e.Value.ToString(); viewCtrl.UpdateObject(info); } } if (obj.InnerData is STViewGroupsInfo) { STViewGroupsController groupCtrl = new STViewGroupsController(); //if ( groupCtrl.GetObjectByNo( e.Value.ToString() )!=null ) //{ // ABCHelper.ABCMessageBox.Show( String.Format( "Group Name : '{0}' is already existed. " , e.Value.ToString() ) , "Message" , MessageBoxButtons.OK , MessageBoxIcon.Error ); // e.Value=strNo; // this.OptionsBehavior.Editable=false; // return; //} STViewGroupsInfo info = (STViewGroupsInfo)obj.InnerData; if (info != null) { info.No = e.Value.ToString(); info.Name = e.Value.ToString(); groupCtrl.UpdateObject(info); } } this.OptionsBehavior.Editable = false; }