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
I am using the same version as yours. I updated it last Friday before reproducing the issue.
Please see the attached screen shots for reference and follow the steps below to reproduce the issue,
1, Modify the code so that it shows exactly like the one below,
2. Compile and Launch the App.
3. Click on the "Add Dock Panel" Menu as shown in the picture below ( #1 in the picture )
4.You will see a new dockpane with title "Test Control Pane" attached to the app as shown in the picture above ( #2 and #3).
5. Click on the close button of the newly created dock pane with the title "Test Control Pane" ( marked #3 in the picture above).
6. After closing it, you will see blank pane attached to the top left corner as shown in the picture below.
Hope it helps.
Thanks,
Hello Suvinay,
Thanks for provided information. I was able to reproduce your issue, but the mentioned behavior is expected after your modification into our sample ( from our Sample browser ), because you when you remove the control Pane, our UltraTilePanel still exist and its parent is the Form, thats why it is appear at the top left corner. Also I made small mofification in the code which create and dock your UltraTilePanel. Could you please take a look at the modifications that I made in the sample and attached video file for more details and let me know if you have any questions.
Regards
Your modification to t he code works well even if I don't do the manual removal of the control and disposing it off. The only issue I came across is that every time I add a new dock panel from the menu, I have to use a unique key otherwise it complains about the key already exists. That means the dockcontrolpane is not disposed but it is jut in a hidden state.
I guess for now I wil manually dispose off so that I can get rid of it completely. I guess you all have to add a property in the dockmanager so that if it is set to true, dockmanager disposes everything when we close instead of hiding it.
ssinha said:The only issue I came across is that every time I add a new dock panel from the menu, I have to use a unique key otherwise it complains about the key already exists. That means the dockcontrolpane is not disposed but it is jut in a hidden state.
You are right about this, but if you are using my suggestion at the beginning of this thread, you could achieve desired behavior. I already made changes in the sample. Please take a look at the latest modification (see current attachment) Also take a look at the attached video file for more details.
Let me know if you have any questions
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample.
Let me know if you have any further questions.