I will specify the object's Member's caption in code at run time!
the object's is inherit XAF's BaseObject,I can set the member Caption in code use attribute,but it is static. I will set the member is dynamic in run time!
how I to do ???
help!
thanks!
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.
Hello Qu,
It is now quite clear when, why and where you want to modify the caption. For example, if you want to change it in a grid, you should access the GridView and change the caption of a required column. If you want to change it in DetailView, you should access the LayoutControl and change the caption of its item. Or, it may be required to change the member's caption via runtime model customization.
If this does not help, please describe your scenario in greater detail.
Thanks,
Anatol
I will change the member's caption via runtime model customization.
But I Can't find the set Object's member's property in code and how to use the IModel interface.
thanks!
Qu,
Here is the code that changes the caption of the Name property, when the SimpleAction is clicked, and synchronizes the current view with these changes:
public partial class ViewController1 : ViewController { public ViewController1() { InitializeComponent(); RegisterActions(components); } private void simpleAction1_Execute(object sender, SimpleActionExecuteEventArgs e) { IModelMember member = ((IModelObjectView)View.Model).ModelClass.FindMember("Name"); if (member != null) { member.Caption = "New Caption"; View.SynchronizeWithInfo(); } } }
Please let me know if you need any further help.
Thanks,
Anatol
OK
thank a lot
this code is my need…
thank a lots.
thanks a lot
You are welcome!
Thanks,
Anatol