Devexpress----GridControl(二)对数据的修改两种方式

       //Job.AE_TRANS_PLANRow currentRow = this.parent.dsMain.AE_TRANS_PLAN.NewAE_TRANS_PLANRow();

            //currentRow.PLAN_ID = CommonTool.GenerateUniqueID();

            //this.parent.dsMain.AE_TRANS_PLAN.AddAE_TRANS_PLANRow(currentRow);

            //this.parent.gvOrdersTran.AddNewRow();
            //Job.AE_TRANS_PLANRow row = this.parent.gvOrdersTran.GetFocusedDataRow() as Job.AE_TRANS_PLANRow;
            //if (row != null)
            //{
               
            //}
            //this.parent.gvOrdersTran.PostEditor();
            //this.parent.gvOrdersTran.UpdateCurrentRow();

            this.parent.gvOrdersTran.AddNewRow();
            Job.AE_TRANS_PLANRow row = this.parent.gvOrdersTran.GetFocusedDataRow() as Job.AE_TRANS_PLANRow;
            if (row != null)
            {
                row.LOADING = "fsdfd";
            }
            this.parent.gvOrdersTran.PostEditor();
            this.parent.gvOrdersTran.UpdateCurrentRow();

 

 

 

2.读取或者修改

 //获取
            ((DataRowView)BindingSource.Current).Row
                //新增
            ((DataRowView)BindingSource.AddNew()).Row;
            BindingSource.EndEdit();
            currentOder.RowState = DataRowState.Added;
            OracleParameter.SourceVersion = DataRowVersion.Original;

            this.dsMain.AE_ORDER.NewAE_ORDERRow();
            this.dsMain.AE_ORDER.AddAE_ORDERRow();
            this.dsMain.GetChanges();
            this.dsMain.AcceptChanges();
            this.dsMain.HasChanges();

            GridControl.PostEditor();
            GridControl.UpdateCurrentRow();
            GridControl.AddNewRow();
            GridControl.RefreshData();

你可能感兴趣的:(第三方控件)