private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //if ( !(this.ParentForm as mainForm).ContextControls.ContainsKey( "PnlNuevaReceta" ) ) { PnlNuevaReceta pnlRecet = new PnlNuevaReceta( ); pnlRecet.Dock = DockStyle.Fill; DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add(pnlRecet); tabItem.Text = "Nueva Receta"; (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem); (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem; // (this.ParentForm as mainForm).ContextControls.Add( "PnlNuevaReceta" , pnlInsumo ); } }
private void ResetFields() { int selectedTabIndex = (this.ParentForm as mainForm).xtraTabControl.SelectedTabPageIndex; PnlNuevaReceta pnlRecet = new PnlNuevaReceta(); pnlRecet.Dock = DockStyle.Fill; DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage(); tabItem.Controls.Add(pnlRecet); tabItem.Text = "nueva receta"; (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem); (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem; (this.ParentForm as mainForm).xtraTabControl.TabPages.RemoveAt(selectedTabIndex); }
private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CommonUtils.Receta recipe = (CommonUtils.Receta)gridViewListaRecetas.GetFocusedRow(); //PnlNuevaReceta pnlReceta = new PnlNuevaReceta((CommonUtils.Receta)((DevExpress.XtraGrid.Views.Grid.GridView)gridControlListaRecetas.Views[0]).GetFocusedRow()); if (recipe != null) { if (!(this.ParentForm as mainForm).ContextControlsForRecetas.ContainsKey(recipe.idReceta.ToString())) { PnlNuevaReceta pnlReceta = new PnlNuevaReceta(recipe); (this.ParentForm as mainForm).ContextControlsForRecetas.Add(recipe.idReceta.ToString(), pnlReceta); pnlReceta.Dock = DockStyle.Fill; DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add(pnlReceta); tabItem.Text = pnlReceta.Receta.nombre; (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem); (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem; // ( this.ParentForm as mainForm ).ContextControls.Add( "PnlNuevaReceta" , pnlReceta ); } } }
private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CommonUtils.Receta recipe = (CommonUtils.Receta)gridViewListaRecetas.GetFocusedRow(); //PnlNuevaReceta pnlReceta = new PnlNuevaReceta((CommonUtils.Receta)((DevExpress.XtraGrid.Views.Grid.GridView)gridControlListaRecetas.Views[0]).GetFocusedRow()); if (recipe != null) { if (!(this.ParentForm as mainForm).ContextControlsForRecetas.ContainsKey(recipe.idReceta.ToString())) { PnlNuevaReceta pnlReceta = new PnlNuevaReceta( recipe ); (this.ParentForm as mainForm).ContextControlsForRecetas.Add(recipe.idReceta.ToString(), pnlReceta); pnlReceta.Dock = DockStyle.Fill; DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add( pnlReceta ); tabItem.Text = pnlReceta.Receta.nombre; ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem ); ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem; // ( this.ParentForm as mainForm ).ContextControls.Add( "PnlNuevaReceta" , pnlReceta ); } } }
private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //if ( !(this.ParentForm as mainForm).ContextControls.ContainsKey( "PnlNuevaReceta" ) ) { PnlNuevaReceta pnlRecet = new PnlNuevaReceta( ); pnlRecet.Dock = DockStyle.Fill; DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add(pnlRecet); tabItem.Text = "Nueva Receta"; ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem ); ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem; // (this.ParentForm as mainForm).ContextControls.Add( "PnlNuevaReceta" , pnlInsumo ); } }