diff --git a/插件库/Lskj.Control/ModulePanelEx.cs b/插件库/Lskj.Control/ModulePanelEx.cs index fbe0c59..5b128dc 100644 --- a/插件库/Lskj.Control/ModulePanelEx.cs +++ b/插件库/Lskj.Control/ModulePanelEx.cs @@ -882,6 +882,10 @@ namespace Lskj.Control tabPage.Controls.AddRange(new PanelControl[] { plBottom, plMain }); if (detailModel.AutoRefresh) { + if (tabPage == this.tcButtom.TabControlObj.TabPages[0] && string.IsNullOrEmpty(this.PrimaryValue)) + { + return; + } if (!string.IsNullOrWhiteSpace(this.ParentKey)) { string codeSql = "select"; @@ -924,12 +928,20 @@ namespace Lskj.Control tabPage.Tag = moduleGrid; if (detailModel.AutoRefresh) { + if (tabPage == this.tcButtom.TabControlObj.TabPages[0] && string.IsNullOrEmpty(this.PrimaryValue)) + { + return; + } moduleGrid.SearchObj.OnDataSourceBindCallBack += new EventHandler(OnMainSearchDataSourceBindCallBack); } } } else { + if (tabPage == this.tcButtom.TabControlObj.TabPages[0] && string.IsNullOrEmpty(this.PrimaryValue)) + { + return; + } if (tabPage.Tag != null && tabPage.Tag is GridControlEx gridControlEx) { GridDetailModel detailModel = gridControlEx.Tag as GridDetailModel;