void showWindowAction_Execute(object sender, SimpleActionExecuteEventArgs e) { NonXAFForm form = new NonXAFForm(); form.Text = "Form with the XAF ListView"; LayoutControl layoutControl = new LayoutControl(); layoutControl.Dock = System.Windows.Forms.DockStyle.Fill; form.Controls.Add(layoutControl); LayoutControlItem item1 = layoutControl.Root.AddItem(); TextBox textBox1 = new TextBox(); item1.Text = "Company"; item1.Control = textBox1; DevExpress.ExpressApp.View listView = Application.CreateListView(typeof(Person), true); listView.CreateControls(); LayoutControlItem item2 = layoutControl.Root.AddItem(); item2.Text = "Persons"; item2.Control = (Control)listView.Control; form.ShowDialog(); listView.Dispose(); form.Dispose(); }
public void SetView(DevExpress.ExpressApp.View view) { ViewSite.Controls.Clear(); if (view != null) { contextMenu.CreateControls(view); view.CreateControls(); if (ViewControlAdding != null) { ViewControlAdding(this, EventArgs.Empty); } ViewSite.Controls.Add((Control)view.Control); ViewCaptionLabel.Text = view.Caption; ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Info.GetAttributeValue("ImageName")); if (imageInfo.IsEmpty) { ViewImage.Visible = false; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } } }
public void SetView(DevExpress.ExpressApp.View view) { this.ViewSite.Controls.Clear(); if (view != null) { contextMenu.CreateControls(view); view.CreateControls(); ViewSite.Controls.Add((Control)view.Control); this.ViewCaptionLabel.Text = view.Caption; Header.Title = view.Caption + " - " + WebApplication.Instance.Title; ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Model.ModelClass.ImageName); if (imageInfo.IsEmpty) { ViewImage.Visible = false; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } if (view is DetailView) { //SearchActionContainer.Visible = false; //ObjectsCreationActionContainer.Visible = false; } } }
public void SetView(DevExpress.ExpressApp.View view) { this.ViewSite.Controls.Clear(); if (view != null) { contextMenu.CreateControls(view); view.CreateControls(); ViewSite.Controls.Add((Control)view.Control); this.ViewCaption.Text = view.Caption; Header.Title = view.Caption + " - " + WebApplication.Instance.Title; ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Info.GetAttributeValue("ImageName")); if (imageInfo.IsEmpty) { ViewImage.Visible = false; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } if (view is DetailView) { SearchActionContainer.Visible = false; ObjectsCreationActionContainer.Visible = false; } //string colorString = view.Info.GetAttributeValue("BackColor"); //if(!string.IsNullOrEmpty(colorString)) { // try { // KnownColor kColor = (KnownColor)Enum.Parse(typeof(KnownColor), colorString); // ViewTitle.BackColor = Color.FromKnownColor(kColor); // } // catch(Exception) { } //} } }
public void SetView(DevExpress.ExpressApp.View view) { ViewSite.Controls.Clear(); if (view != null) { contextMenu.CreateControls(view); view.CreateControls(); if (ViewControlAdding != null) { ViewControlAdding(this, EventArgs.Empty); } ViewSite.Controls.Add((Control)view.Control); ViewCaption.Text = view.Caption; ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Info.GetAttributeValue("ImageName")); if (imageInfo.IsEmpty) { ViewImage.Visible = false; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } string colorString = view.Info.GetAttributeValue("BackColor"); //if(!string.IsNullOrEmpty(colorString)) { // try { // KnownColor kColor = (KnownColor)Enum.Parse(typeof(KnownColor), colorString); // //ViewTitle.BackColor = Color.FromKnownColor(kColor); // } // catch(Exception) { } //} } }
private void BuildContent() { Content.Controls.Clear(); ControlUniqueIDList.Clear(); switch (ViewType) { case Web.ViewType.DetailView: if (View == null) { return; } if (ControlToRender == null) { if (View is DetailView && !(View as DetailView).IsControlCreated) { View.CreateControls(); } } AddContent(new HTMLText() { Text = @"<div>" }, Content); if (ControlToRender != null) { BuildRecursiveElement(ControlToRender, null, ElemType.SingleObject, Content); } else { BuildRecursiveElement((Control)View.Control, null, ElemType.SingleObject, Content); } AddContent(new HTMLText() { Text = @"</div>" }, Content); break; case Web.ViewType.ListView: ListTable = new XafBootstrapTable(); ListTable.ListView = (IModelListView)(WebApplication.Instance as XafApplication).Model.Views[ModelListViewID]; ListTable.DataSource = DataSource; ListTable.PropertyName = PropertyName; ListTable.SelectionType = SelectionType; Content.Controls.Clear(); Content.Controls.Add(ListTable); break; } }
public void SetView(DevExpress.ExpressApp.View view) { ViewSite.Controls.Clear(); if (view != null) { contextMenu.CreateControls(view); view.CreateControls(); ViewSite.Controls.Add((Control)view.Control); ViewCaptionLabel.Text = view.Caption; ImageInfo imageInfo = ImageLoader.Instance.GetImageInfo(view.Model.ModelClass.ImageName); if (imageInfo.IsEmpty) { ViewImage.Visible = false; ViewImage.ImageUrl = null; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } } }
public void SetView(DevExpress.ExpressApp.View view) { ViewSite.Controls.Clear(); if (view != null) { contextMenu.CreateControls(view); view.CreateControls(); ViewSite.Controls.Add((Control)view.Control); ViewCaption.Text = view.Caption; ImageInfo imageInfo = ImageLoader.Instance.GetImageInfo(view.Info.GetAttributeValue("ImageName")); if (imageInfo.IsEmpty) { ViewImage.Visible = false; ViewImage.ImageUrl = null; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } OnViewInfoChanged(); } }
public void SetView(DevExpress.ExpressApp.View view) { this.ViewSite.Controls.Clear(); if (view != null) { view.CreateControls(); if (ViewControlAdding != null) { ViewControlAdding(this, EventArgs.Empty); } ViewSite.Controls.Add((Control)view.Control); ViewCaptionLabel.Text = view.Caption; Header.Title = view.Caption; ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Model.ImageName); if (imageInfo.IsEmpty) { ViewImage.Visible = false; } else { ViewImage.ImageUrl = imageInfo.ImageUrl; } } }