Close/Open etc... Document programmatically.
I would like to perform a LINQ query (or for/foreach) to find the document that implements a particular interface, this is possible?
Example :
private IDebugEditor GetDebugEditor() { |
var res = from w in radDocking.Documents where w is IDebugEditor select w; |
if (res.Count() != 0) |
return (IDebugEditor)res.First(); |
return null; |
} |
7 Answers, 1 is accepted
There is no particular functionality for the DocumentPanes, but you could get all the panes and filter only the panes in the DocumentHost. Here is an example:
dock.Panes.Where(pane => pane.IsInDocumentHost)
Hope this helps.
Sincerely yours,Miroslav Nedyalkov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
thanks for you help, how do I remove a pane at runtime ?
To add I used this method : (DebugEditor is a RadDocumentPane)
((DocumentHost)dock.DocumentHost).AddPane(new DebugEditor()); |
it's correct ?
Is this code working correctly? In my opinion the DocumentHost property is expected to of type RadSplitContainer, so it should always throw InvalidCastException. (If you added a DocumentHost control into the DocumentHost property, you shouldn't do that - the Docking control has one in its ControlTemplate and it expects a SplitContainer in this property).
You might us the following code for adding panes:
var dhContainer = dock.DocumentHost
as
RadSplitContainer;
var documentHost = dhContainer.Parent
as
DocumentHost;
documentHost.AddPane(
new
DebugEditor());
Hope this helps.
All the best,Miroslav Nedyalkov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
var dhContainer = dockSite.DocumentHost as RadSplitContainer; |
var documentHost = dhContainer.Parent as DocumentHost; |
//documentHost.AddPane(new DebugEditor()); |
documentHost.AddPane(new RadPane()); |
I'm sorry, but the AddPane method of the DocumentHost is meant to be used when you need to move a pane from one place to the DocumentHost - not for adding new panes. I would suggest you to put a Name to a group in the DocumetHost and add the panes to it. Please refer to the attached example project.
Greetings,Miroslav Nedyalkov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Set the SerializationTag attached property to all the panes should resolve the problem. If it doesn't help, please provide us with a sample project that reproduces the problem - this will help us find out what the problem is and provide you an appropriate solution.
Kind regards,Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.