public DataTable EditValue(DataTable value) { DatasetBrowser dsb = new DatasetBrowser(); dsb.ResultsDatatable = value; dsb.ShowDialog(); return(dsb.ResultsDatatable); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { Dataset ds = context.Instance as Dataset; DataTable dt; bool isStored = ds.IsResultsStored; System.Diagnostics.Debug.Print(isStored.ToString()); if (value == null) { if (ds.Query != null) { dt = ds.RetrieveDataTable(); } else { dt = new DataTable("Results"); } } else { dt = value as DataTable; } DatasetBrowser dsb = new DatasetBrowser(); dsb.ResultsDatatable = dt; dsb.FormIsResultsStored = isStored; dsb.OpenedDataset = ds; dsb.OriginalResultsDatatable = dt.Copy(); dsb.ShowDialog(); //return dsb.ResultsDatatable; if (dsb.DialogResult == DialogResult.OK) { return(dsb.ResultsDatatable); } else { return(dsb.OriginalResultsDatatable); } //return this.EditValue(dt); }