Hello Sir,
In my application i have two currencies First Base Currency and Second Base Currency.
In my invoice I have a field called "RateToFB" Rate to first base currency.
I have a problem; every time i change the first base currency i rename this field to the changed currency.
Example if First base currency is USD i rename this field to "RateTo USD"
if First base currency is EURO i rename this field to "RateTo EURO".
For this purpose i want to change this caption at run time
1- before loading the view (list/DetailView) read what is First base currency
2- Change its value.
I created a controller to do this but still facing some problems
the code below is for the view controller:
protected override void OnActivated()
{
if (View is DetailView)
((DevExpress.ExpressApp.Win.Layout.WinLayoutManager)((View as DetailView).LayoutManager)).ItemCreated += ItemCreated;
}
void ItemCreated(object sender, DevExpress.ExpressApp.Win.Layout.ItemCreatedEventArgs e)
{
if(fb==null)
fb=View.ObjectSpace.GetFirstBaseCurrency();
if(sb==null)
sb=View.ObjectSpace.GetSecondBaseCurrency();
if (typeof(Invoice).IsAssignableFrom(View.ObjectTypeInfo.Type))
{
if (e.ViewItem != null && e.ViewItem is DevExpress.ExpressApp.Win.Editors.LookupPropertyEditor)
{
DevExpress.ExpressApp.Win.Editors.LookupPropertyEditor editor = (DevExpress.ExpressApp.Win.Editors.LookupPropertyEditor)e.ViewItem;
if (fb!=null && editor.PropertyName.Contains("RateToFB") && editor.Caption!=fb.ISOCurrencySymbol)
{
(sender as DevExpress.ExpressApp.Win.Layout.WinLayoutManager).EnableCaptionColon=false;
editor.Caption = fb.ISOCurrencySymbol;
(sender as DevExpress.ExpressApp.Win.Layout.WinLayoutManager).Container.Refresh();
}
if (sb!=null && editor.PropertyName.Contains("RateToSB")&& editor.Caption!=sb.ISOCurrencySymbol)
{
(sender as DevExpress.ExpressApp.Win.Layout.WinLayoutManager).EnableCaptionColon=false;
editor.Caption = sb.ISOCurrencySymbol;
(sender as DevExpress.ExpressApp.Win.Layout.WinLayoutManager).Container.Refresh();
}
}
}
}
please help me to solve the following problems:
1-not available for list view
2-I still need to open the detail view twice to apply the new value using this controller.
Thank you,
Ali
Hi Ali,
Thank you for contacting us. I fully understand your task and need some time to fix your controller.
It does not work for ListViews because it is not supposed to do so as WinLayoutManager.ItemCreated is primarily fused or DetailView. In case of ListView you will have to access GridControl columns and change their caption.
Refer to the Access Editor Settings help article for more information.
Thanks,
Dennis
P.S.
Our record shows that your Master account has no personal developer license assigned for the Contact account you currently use with our Support Cervices. Please ask your manager to assign a license for you. This can be accomplished through the “Purchase | Manage & Assign Licenses” menu of our web site (authorization required).