Hi All,
I ran across the same issue as described in the following link, http://community.infragistics.com/forums/t/1113.aspx
I tried the solution proposed and it worked to a large extent. When I click on the X button I get a panehidden message, where I close my control and dispose the dockcontrolpane. When I save and load the layout, I get a empty panel in the top left corner. After playing around with it quite a bit I couldn't get around removing the blank panel.
Is there a solution for this? Can you point me in the right direction ?
See my creation code and remove code below,
.// My usercontrol
LiveVariableDataControl wpf = new LiveVariableDataControl();
wpf.Size = new Size(200, 200);
UltraTile tile = new UltraTile();
tile.Control = wpf;
UltraTilePanel tilep = new UltraTilePanel();
tilep.TileSettings.ShowCloseButton = Infragistics.Win.DefaultableBoolean.True;
tilep.Appearance.BackColor = Color.Transparent;
tilep.add(tile);
DockableControlPane dockableControlPane1 = new DockableControlPane(tilep);
dockableControlPane1.Size = new Size(210, 210);
dockableControlPane1.Settings.Appearance.BackColor = Color.Transparent;
DockAreaPane flpane = MainFormDockManager.DockAreas.Add(DockedLocation.DockedLeft);
flpane.Panes.Add(dockableControlPane1);
flpane.Closed = false;
flpane.Tag = id;
flpane.Size = new System.Drawing.Size(264, 583);
flpane.Settings.Appearance.BackColor = Color.Transparent;
//Pane Hidden method
private void MainFormDockManager_PaneHidden(object sender, PaneHiddenEventArgs e)
{
removeControlPaneAndChildren(e.Pane);
e.Pane.Closed = true;
}
private void removeControlPaneAndChildren(DockableControlPane pane)
UltraTilePanel tilep = pane.Control as UltraTilePanel;
if (tilep != null)
while (tilep.Tiles.Count > 0)
UltraTile tile = tilep.Tiles[0];
IUIControl ctrl = (IUIControl)tile.Control;
ctrl.close();
tile.Control.Dispose();
tilep.Tiles.Remove(tile);
tile.Dispose();
pane.Dispose();
Any help is greatly appreciated
Thanks!
Hello Ssinha,
I`m not sure that I understand well your scenario, but when I try the code below I`m able to remove the hiden Panes from my ControlPanesCollection.
private bool IsRemoved; private void ultraDockManager1_PaneHidden(object sender, PaneHiddenEventArgs e) { if (!IsRemoved) { IsRemoved = true; ultraDockManager1.ControlPanes.Remove(e.Pane.Control); IsRemoved = false; } }
private bool IsRemoved;
private void ultraDockManager1_PaneHidden(object sender, PaneHiddenEventArgs e)
if (!IsRemoved)
IsRemoved = true;
ultraDockManager1.ControlPanes.Remove(e.Pane.Control);
IsRemoved = false;
Please take a look at the attached video with debuging of my test sample. Please take a look at the total numbers of the Panes at the beggining and at the end of the test. Let me know if you think that I misunderstand your scenario or if you have any questions.
Hi Georgi,
Thanks for looking in to this issue.
I reproduced this issue in the sample app infragistics provided when you install the software. I have added the sample project. I have upgraded the project to run in VS2010. Please take a look.
I am using a UltraTilePanel programmatically and docking it. See the code snippet below for adding the UltraTilePanel,
private void addDockPanelMenuItem_Click(object sender, EventArgs e) { UltraTilePanel tp = new UltraTilePanel(); tp.TileSettings.ShowCloseButton = DefaultableBoolean.True; tp.Appearance.BackColor = Color.Transparent; tp.Text = "Test TilePanel"; tp.Tag = Guid.NewGuid().ToString(); System.Diagnostics.Trace.WriteLine(tp.Tag.ToString());
DockableControlPane dockcp = new DockableControlPane(tp); dockcp.Size = new Size(210, 210); dockcp.Settings.Appearance.BackColor = Color.Transparent; dockcp.Text = "Test Control Pane";
DockAreaPane flpane = ultraDockManager1.DockAreas.Add(DockedLocation.DockedLeft); flpane.Panes.Add(dockcp); flpane.Closed = false; flpane.Size = new System.Drawing.Size(264, 583); flpane.Settings.Appearance.BackColor = Color.Transparent;
I remove the UltraTilePanel when the user closes the dockcontrolpane. See the code snippet below,
private void ultraDockManager1_PaneHidden(object sender, PaneHiddenEventArgs e) { UltraTilePanel tp = e.Pane.Control as UltraTilePanel;
if (tp != null) { this.LogPaneEvent("[PaneHidden]", e.Pane); System.Diagnostics.Trace.WriteLine(tp.Tag.ToString()); ultraDockManager1.ControlPanes.Remove(tp); tp.Dispose(); tp = null; } }
To reproduce the issue, remove the following 2 lines from the paneHidden method,
tp.Dispose(); tp = null;
Now when you close the dockcontrolpane, You will see a dark Panel on the left top. What it says to me is, when I remove the control from the dock control pane, it doesn't actually remove, I have to explicitly call the Dispose() and set it to null to remove it completely.
Guess that solves my problem but I hoped it worked nicely since I was using Infragistics toolset.
Regards,
-Suvinay