Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Garth,
We have introduced a couple of events into the WinLayoutManage class that will allow you to manage saving and restoring a control's properties in the application model.
These are the events: SynchronizeItemInfo and ItemCreated
and two virtual methods:
protected virtual void OnSynchronizeItemInfo(DictionaryNode dictionaryNode, BaseLayoutItem itemInfo)
protected virtual void OnItemCreated(BaseLayoutItem item, DictionaryNode itemInfo, DetailViewItem detailViewItem)
Handling these events (overriding virtual methods) will affect only the application and NOT the MODEL EDITOR (either invoked at design time in Visual Studio or at runtime from your application).
This is how you can use these methods:
public class MyWinLayoutManager : WinLayoutManager { protected override void OnItemCreated(BaseLayoutItem item, DictionaryNode itemInfo, DevExpress.ExpressApp.Editors.DetailViewItem detailViewItem) { base.OnItemCreated(item, itemInfo, detailViewItem); TabbedGroup tabbedGroup = item as TabbedGroup; if(tabbedGroup != null) { tabbedGroup.HeaderOrientation = ExtractTabOrientation(itemInfo); } } protected override void OnSynchronizeItemInfo(DictionaryNode dictionaryNode, BaseLayoutItem itemInfo) { base.OnSynchronizeItemInfo(dictionaryNode, itemInfo); TabbedGroup tabbedGroup = itemInfo as TabbedGroup; if(tabbedGroup != null) { dictionaryNode.SetAttribute("HeaderOrientation", tabbedGroup.HeaderOrientation.ToString()); } } private TabOrientation ExtractTabOrientation(DictionaryNode itemInfo) { TabOrientation result = TabOrientation.Default; if(itemInfo != null) { String tabOrientation = itemInfo.GetAttributeValue("HeaderOrientation"); if(!String.IsNullOrEmpty(tabOrientation)) { try { result = (TabOrientation)Enum.Parse(typeof(TabOrientation), tabOrientation, true); } catch { } } } return result; } }
protected override DevExpress.ExpressApp.Layout.LayoutManager CreateLayoutManagerCore(bool simple) { if(simple) { return new WinSimpleLayoutManager(); } else { DictionaryNode optionsNode = Model.RootNode.GetChildNode(OptionsNodeName); DictionaryNode layoutOptionsNode = optionsNode.GetChildNode("LayoutManagerOptions"); MyWinLayoutManager manager = new MyWinLayoutManager(); manager.CustomizationEnabled = layoutOptionsNode.GetAttributeBoolValue("CustomizationEnabled", manager.CustomizationEnabled); manager.VerticalSpace = layoutOptionsNode.GetAttributeIntValue("VerticalSpace", manager.VerticalSpace); manager.HorizontalSpace = layoutOptionsNode.GetAttributeIntValue("HorizontalSpace", manager.HorizontalSpace); manager.GroupVerticalPadding = layoutOptionsNode.GetAttributeIntValue("GroupVerticalPadding", manager.GroupVerticalPadding); manager.GroupVerticalSpace = layoutOptionsNode.GetAttributeIntValue("GroupVerticalSpace", manager.GroupVerticalSpace); manager.IgnoreSpacesInSimpleGroup = layoutOptionsNode.GetAttributeBoolValue("IgnoreSpacesInSimpleGroup", manager.IgnoreSpacesInSimpleGroup); return manager; } }
Note: implementing this suggestion doesn't allow you to save all settings of the layout control, because we do not serialize the control, but we simply store some properties of the control (please check the B97105 issue for more details).
Thanks,
Dennis
These enhancements are both cool and well thought through. Thank you, Dennis.
I'm waiting for a couple of fixes to reported 8.2.4 bugs before upgrading.
I've got a couple of application requirements that these events may be the solution for.
Thank you for the feedback, Garth!
You are always welcome!
Mahalo,
Dennis
Hi Dennis,
Is this still a relevant solution?
In a ListViewAndDetailView mode, the end-user needs the ListView to be collapsible like a dockable panel to the right side of the view. They need this for smaller monitors. Can you please advise how this can be done the fastest way?
Thanks
Genesis
@Genesis: I've created a separate ticket on your behalf (T900233: In a ListViewAndDetailView mode, the end-user needs the ListView to be collapsible like a dockable panel to the right side of the view). It has been placed in our processing queue and will be answered shortly.