|
public class DataFormLayoutManagerExt : DataFormLayoutManager
{
public DataFormLayoutManagerExt(SfDataForm dataform) : base(dataform)
{
}
protected override void OnEditorCreated(DataFormItem dataFormItem, View editor)
{
if (dataFormItem.Name == "Name")
{
(editor as EditText).SetBackgroundColor(Color.Pink);
}
base.OnEditorCreated(dataFormItem, editor);
}
}
dataForm.LayoutManager = new DataFormLayoutManagerExt(dataForm); |
Hi Thangapriya,
The field and label formatting worked as a charm! As for the visible/invisible field setting, it was a bit messy as when I called the RefreshLayout in the PropertyChanged event, cause it created a loop on itself. I circumvent this by the use of the IsVisible property as follows:
var dataFormItem1 = dataForm.ItemManager.DataFormItems["Diam"];
dataFormItem1.IsVisible = true;
Now I wonder if an event exist for commited DropDown? And I have an additional question if you allow me, how can we call a value from another, say we are in DataFormGettingStarted.cs, and we want to fetch the "Amount" variable in the RecipientInfo.cs in the runtime. Now I am using a global variable, but looking a more effective way to work this out
Thank you!
Nicolas
N.B. Found the way to get the data:
DataFormItem dfi_Diam;
dfi_Diam = dataForm.ItemManager.DataFormItems["RC_Diam"];
dia = (double)dfi_Diam.ItemManager.GetValue(dfi_Diam);
|
Query |
Details | |
|
RefreshLayout in the PropertyChanged event, cause it created a loop on itself |
You can do DataFormItems manipulation like add or remove, changing visibility etc,.. based on another property in PropertyChanged event only. You can use the args.PropertyName conditional check to avoid the loop.
Within condition you can change the Visibility of the DataFormItem. | |
|
Now I wonder if an event exist for commited DropDown? |
Currently we don’t have an event after committing the DataFormItem values. However you can achieve the needed operation in PropertyChanged event itself.
| |
|
how can we call a value from another, say we are in DataFormGettingStarted.cs, and we want to fetch the "Amount" variable in the RecipientInfo.cs in the runtime. |
You can change the value of another variable of DataFormItem from PropertyChanged event of DataObject.
Please refer the below UG link.
|
Nice!!! Work as a charm! Thank you for your support
Nicolas