Exemplo n.º 1
0
        protected override int Edit( )
        {
            if (row == null)
            {
                XtraMessageBox.Show("请选择需要编辑的列");
                return(0);
            }
            ChildForm.FormMaPlate from = new ChildForm.FormMaPlate(model);
            from.StartPosition = FormStartPosition.CenterScreen;
            if (from.ShowDialog( ) != DialogResult.OK)
            {
                return(0);
            }
            model = from.getModel;
            if (model == null)
            {
                return(0);
            }
            row = null;
            row = tableView.Rows [selectIdx];
            row.BeginEdit( );
            setColumn(row);
            row.EndEdit( );
            gridControl1.RefreshDataSource( );
            row = null;

            return(base.Edit( ));
        }
Exemplo n.º 2
0
        protected override int Add( )
        {
            ChildForm.FormMaPlate from = new ChildForm.FormMaPlate(null);
            from.StartPosition = FormStartPosition.CenterScreen;
            if (from.ShowDialog( ) != DialogResult.OK)
            {
                return(0);
            }
            model = from.getModel;
            if (model == null)
            {
                return(0);
            }
            row         = null;
            row         = tableView.NewRow( );
            row ["idx"] = model.idx;
            setColumn(row);
            tableView.Rows.Add(row);
            gridControl1.RefreshDataSource( );
            row = null;

            return(base.Add( ));
        }