Profile Picture

disapearing Chart when using docking manager

Posted By Rolf Sooss 15 Years Ago
Author
Message
Rolf Sooss
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 5, Visits: 1
Hi

i am trieing to have some docking panels on the right side of the form, and a chart with chartcommandbar on the form. But a s soon as i add the dockingpanel, the chart disapears in design view. I can get it back up by using "bring to front", but when i debug the chart is missing. i then tried to put the chart in a dockingpanel, but then the docking panel is not filling the full height/weidth and that doesn´t look that good. I tried to fix the disapearing with differnet zvalues, but still it didn´t show the Chart when positioned on the form.
2nd Thing is that i want to have 4 docking panles on the right (no problem so far) but all 4 docking panels are shown in design view side by side and the size is automatically changed and overwriting this in designview is impossible. If there is an easy way how to show/hide the docking panels in design view so that thea are not resized evrey time?
Just to make sure i have a form that is 1000x720px and the docking panels should be full height and width from 300 to 900px.

Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hello Rolf,

When you put NDockManager control on your form, the form becomes MDI form. That's why controls on the form diasppear.

If you want to put NChartControl and NChartCommandBarsManager controls you need to put them in NUIDocument.

Here is a sample code that shows how this can be achieved:

NUIDocument doc = new NUIDocument();

Panel panel = new Panel();

panel.Dock = DockStyle.Fill;

doc.Client = panel;           

 

NChartControl nChartControl1 = new NChartControl();

nChartControl1.Size = new Size(500, 300);

nChartControl1.Location = new Point(10, 60);

panel.Controls.Add(nChartControl1);

 

NChartCommandBarsManager chartCommandsManager = new NChartCommandBarsManager();

chartCommandsManager.ChartControl = nChartControl1;

 

chartCommandsManager.ParentControl = panel; 

 

nDockManager1.DocumentStyle.DocumentViewStyle = DocumentViewStyle.SingleDocument;

nDockManager1.DocumentManager.AddDocument(doc);

 

Regarding  the second question the docking panels have different size setups depending of their state.

If you want the state of your panels to be AutoHide you need to setup PrefferedState property to AutoHide.

In design view the panels will remain docked, but in runtime they will be in AutoHide state.

To setup the size of the panel when the state is AutoHide you need to setup TabInfo.AutoHIdeSize property.

Analogically if you want to setup the size when the panel is in Docked state you have to setup SizeInfo.PrefferedSize property.

I hope this post will help you to setup your docking panels correctly.

Regards,

Angel Chorbadzhiev.



Rolf Sooss
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 5, Visits: 1
So the Solution you suggested was working fine and i did try some other Layouts then. So i came up with the idea of putting everything in its own docking panel. (chart, ChartCommandBar,and 5 other docking panels to modify the data or the look of the charts.
What happens now is that Everything looks good except for the Chart not being 3D (3D button in ChartCommandBar is active?!) and nothing is shown on the chartcontrol.
When i click on the "toggle 3D" button once to turn 3D off and then once again to activate 3D-View again: The Chart is showing and i can fully control it with the ChartCommandBar.
But i have other things in the docking panel that just don´t work: graphic style like transparency, toggle visible on/off.
I started this Layout with a naked form, then attached the Docking Manager and started creating new docking Panels in DesignView. What am i missing?
How can i control or change status from within another docking panel, and why does the chart not load proper (in Chart Editor the SurfaceChart is shown and dataPoints are ok).


bob milanov
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi Rolf,

It looks like there is a problem with the designer serialization - it cannot force the control to switch to 3D when loaded back from a form, even though the document is configured properly. This issue is fixed in the upcoming release. For the time being you can easily workaround it by triggering the enable3D property:

private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
bool enable3D = chart.Enable3D;
chart.Enable3D = !enable3D;
chart.Enable3D = enable3D;
nChartControl1.Refresh();
}

Hope this helps - let me know if you meet any problems or have any questions.

Best regards,
Bob



Rolf Sooss
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 5, Visits: 1
Thanks Bob, this works perfect!

i did try with;
chart.enable3D = enable3D; but the exclamation mark was the trick here.

Hope your making good progress with the enhancement of the render engine.



Similar Topics


Reading This Topic