I am trying to build menus and UIs dynamically using wisej controls. I will create the UI first using Design to create the Wisej web page front end. Then, I will go into the wisej webpage designer cs file to get the code. I have copied and pasted it under a public C# function to run it. When debugging it, it steps through the code, but does not appear in the front end of wisej web page. I am I missing something for coding dynamic wisej front ends for wisej web pages. Example is below that I was using. I also made sure that visibility on all of the wisej controls were set to true. Also, can you tell me what I am doing wrong and also provide an example on how to do this?
thanks
Greg
Example code:
public partial class testDynMenu : Wisej.Web.UserControl
{
private Wisej.Web.Panel pnlMenu;
private Wisej.Web.Line line1;
private Wisej.Web.FlowLayoutPanel pnlAdminMenu;
private Wisej.Web.Button btnSystemUsers;
private Wisej.Web.Button btnProvUsers;
private Wisej.Web.Button btnProvClients;
private Wisej.Web.Button btnAVideo;
private Wisej.Web.Button btnAWait;
public testDynMenu()
{
InitializeComponent();
loadDynamicMenu();
}
public void loadDynamicMenu()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(testMenu));
this.pnlMenu = new Wisej.Web.Panel();
this.line1 = new Wisej.Web.Line();
this.pnlAdminMenu = new Wisej.Web.FlowLayoutPanel();
this.btnSystemUsers = new Wisej.Web.Button();
this.btnProvUsers = new Wisej.Web.Button();
this.btnProvClients = new Wisej.Web.Button();
this.btnAVideo = new Wisej.Web.Button();
this.btnAWait = new Wisej.Web.Button();
this.pnlMenu.SuspendLayout();
this.pnlAdminMenu.SuspendLayout();
this.SuspendLayout();
//
// pnlMenu
//
this.pnlMenu.BorderStyle = Wisej.Web.BorderStyle.Solid;
this.pnlMenu.Controls.Add(this.line1);
this.pnlMenu.Controls.Add(this.pnlAdminMenu);
this.pnlMenu.Dock = Wisej.Web.DockStyle.Left;
this.pnlMenu.Location = new System.Drawing.Point(0, 0);
this.pnlMenu.Name = “pnlMenu”;
this.pnlMenu.ResponsiveProfiles.Add(((Wisej.Base.ResponsiveProfile)(resources.GetObject(“pnlMenu.ResponsiveProfiles”))));
this.pnlMenu.Size = new System.Drawing.Size(215, 593);
this.pnlMenu.TabIndex = 5;
this.pnlMenu.TabStop = true;
this.pnlMenu.Visible = false;
//
// line1
//
this.line1.Dock = Wisej.Web.DockStyle.Right;
this.line1.Location = new System.Drawing.Point(203, 0);
this.line1.Name = “line1”;
this.line1.Orientation = Wisej.Web.Orientation.Vertical;
this.line1.ResponsiveProfiles.Add(((Wisej.Base.ResponsiveProfile)(resources.GetObject(“line1.ResponsiveProfiles”))));
this.line1.Size = new System.Drawing.Size(10, 591);
//
// pnlAdminMenu
//
this.pnlAdminMenu.Controls.Add(this.btnSystemUsers);
this.pnlAdminMenu.Controls.Add(this.btnProvUsers);
this.pnlAdminMenu.Controls.Add(this.btnProvClients);
this.pnlAdminMenu.Controls.Add(this.btnAVideo);
this.pnlAdminMenu.Controls.Add(this.btnAWait);
this.pnlAdminMenu.Location = new System.Drawing.Point(3, 17);
this.pnlAdminMenu.Name = “pnlAdminMenu”;
this.pnlAdminMenu.Size = new System.Drawing.Size(200, 405);
this.pnlAdminMenu.TabIndex = 12;
this.pnlAdminMenu.TabStop = true;
this.pnlAdminMenu.Visible = false;
//
// btnSystemUsers
//
this.pnlAdminMenu.SetFillWeight(this.btnSystemUsers, 1);
this.pnlAdminMenu.SetFlowBreak(this.btnSystemUsers, true);
this.btnSystemUsers.Location = new System.Drawing.Point(3, 3);
this.btnSystemUsers.Name = “btnSystemUsers”;
this.btnSystemUsers.Size = new System.Drawing.Size(194, 27);
this.btnSystemUsers.TabIndex = 10;
this.btnSystemUsers.Text = “System Users”;
this.btnSystemUsers.Click += new System.EventHandler(this.btnSystemUsers_Click);
//
// btnProvUsers
//
this.pnlAdminMenu.SetFillWeight(this.btnProvUsers, 1);
this.pnlAdminMenu.SetFlowBreak(this.btnProvUsers, true);
this.btnProvUsers.Location = new System.Drawing.Point(3, 36);
this.btnProvUsers.Name = “btnProvUsers”;
this.btnProvUsers.Size = new System.Drawing.Size(194, 27);
this.btnProvUsers.TabIndex = 11;
this.btnProvUsers.Text = “Providers”;
this.btnProvUsers.Click += new System.EventHandler(this.btnProvUsers_Click);
//
// btnProvClients
//
this.pnlAdminMenu.SetFillWeight(this.btnProvClients, 1);
this.pnlAdminMenu.SetFlowBreak(this.btnProvClients, true);
this.btnProvClients.Location = new System.Drawing.Point(3, 69);
this.btnProvClients.Name = “btnProvClients”;
this.btnProvClients.Size = new System.Drawing.Size(194, 27);
this.btnProvClients.TabIndex = 12;
this.btnProvClients.Text = “Provider\’s Clients”;
this.btnProvClients.Click += new System.EventHandler(this.btnProvClients_Click);
//
// btnAVideo
//
this.pnlAdminMenu.SetFillWeight(this.btnAVideo, 1);
this.pnlAdminMenu.SetFlowBreak(this.btnAVideo, true);
this.btnAVideo.Location = new System.Drawing.Point(3, 102);
this.btnAVideo.Name = “btnAVideo”;
this.btnAVideo.Size = new System.Drawing.Size(194, 27);
this.btnAVideo.TabIndex = 13;
this.btnAVideo.Text = “Video Session”;
this.btnAVideo.Click += new System.EventHandler(this.btnAVideo_Click);
//
// btnAWait
//
this.pnlAdminMenu.SetFillWeight(this.btnAWait, 1);
this.pnlAdminMenu.SetFlowBreak(this.btnAWait, true);
this.btnAWait.Location = new System.Drawing.Point(3, 135);
this.btnAWait.Name = “btnAWait”;
this.btnAWait.Size = new System.Drawing.Size(194, 27);
this.btnAWait.TabIndex = 14;
this.btnAWait.Text = “Waiting Room”;
this.btnAWait.Click += new System.EventHandler(this.btnAWait_Click);
//
// testMenu
//
this.Controls.Add(this.pnlMenu);
this.Name = “testMenu”;
this.Size = new System.Drawing.Size(847, 593);
this.pnlMenu.ResumeLayout(true);
this.pnlAdminMenu.ResumeLayout(true);
this.ResumeLayout(true);
}
Hi Greg,
Wisej designer in Visual Studio doesn’t recognize your code because the designer execute UI from method InitializeComponent()
And after debug is not visible because IsVisible property is false on your Panel
PS. All wisej widget (Component) are C# class you can manipulate it directly with C#
Eg :
Button button = new Button();
button.Text = "Simple test";
button.Dock = DockStyle.Top;
Panel container = new Panel();
container.Dock = DockStyle.Fill;
container.Controls.Add(button);
Best,
Kevin (ITG)
Please login first to submit.