public frmPO() { InitializeComponent(); this.Load += frm_Load; //实例化必须,bllBusinessBase必须替换为bll层自己继承的子类(指定正确的dal.DBCode),建议封装重写到项目bll层 _bll = bll = new bllPO(); DataTable dt = new DataTable(); dt.Columns.Add("value", typeof(System.Int32)); dt.Columns.Add("text", typeof(System.String)); }
/// <summary> /// 初始化窗体/// /// </summary> protected override void InitializeForm() { _BLL = new bllPO();// 业务逻辑管理类 _SummaryView = new DevGridView(gvSummary); _ActiveEditor = txtPONo; _DetailGroupControl = panelControl3; base.InitializeForm(); frmGridCustomize.RegisterGrid(gvSummary); DevStyle.SetGridControlLayout(gcSummary, false); //表格设置 DevStyle.SetGridControlLayout(gcDetail, true); //表格设置 DevStyle.SetSummaryGridViewLayout(gvSummary); DevStyle.SetDetailGridViewLayout(gvDetail); BindingSummaryNavigator(controlNavigatorSummary, gcSummary); //Summary导航条. BindingSummarySearchPanel(btnQuery, btnEmpty, gcFindGroup); gcDetail.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(this.OnEmbeddedNavigatorButtonClick); //表格按钮事件 gvDetail.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(OnCellValueChanged); //表格值改变 gvSummary.DoubleClick += new EventHandler(OnGridViewDoubleClick); //主表DoubleClict txt_DocDateTo.DateTime = DateTime.Today; //查询条件 DataBinder.BindingLookupEditDataSource(txtCreatedBy, DataDictCache.Cache.User, "UserName", "Account"); DataBinder.BindingLookupEditDataSource(txtPayType, DataDictCache.Cache.PayType, "TypeName", "PayType"); DataBinder.BindingLookupEditDataSource(txtAppUser, DataDictCache.Cache.User, "UserName", "Account"); DataBinder.BindingLookupEditDataSource(txtPOUser, DataDictCache.Cache.Person, "SalesName", "SalesCode"); DataBinder.BindingLookupEditDataSource(txtCurrency, DataDictCache.Cache.Currency, "CurrencyName", "Currency"); (colD_ProductCode.ColumnEdit as RepositoryItemButtonEdit).ButtonClick += new ButtonPressedEventHandler(OnStockCode_ButtonClick); (colD_ProductCode.ColumnEdit as RepositoryItemButtonEdit).Validating += new CancelEventHandler(OnStockCode_Validating); _BLL.GetBusinessByKey("-", true); //加载一个空的业务对象. ShowSummaryPage(true); //一切初始化完毕后显示SummaryPage }