[C#]
public class DataFormLayoutManagerExt : DataFormLayoutManager
{
public DataFormLayoutManagerExt(SfDataForm dataForm) : base(dataForm)
{
}
protected override double GetEditorWidth(DataFormItem dataFormItem, double availableWidth)
{
if (dataFormItem.Name.Equals("LastName"))
{
return 0;
}
else
{
return base.GetEditorWidth(dataFormItem, availableWidth);
}
}
} |
[C#]
public class DataFormTextEditorExt : DataFormTextEditor
{
public DataFormTextEditorExt(SfDataForm dataForm) : base(dataForm)
{
}
protected override void OnUpdateReadOnly(DataFormItem dataFormItem, Entry view)
{
view.IsReadOnly = dataFormItem.IsReadOnly;
}
}
dataForm.RegisterEditor("Text", new DataFormTextEditorExt(dataForm));
|
[C#]
//Initialize data field as checkbox item and provide values for Height and LabelPosition properties.
if (key == "Details")
dataFormItem = new DataFormCheckBoxItem() { Name = key, Editor = "Bool", Height = 1, LabelPosition = LabelPosition.Top };
//Customizing DataFormLayoutManager class
public class DataFormLayoutManagerExt : DataFormLayoutManager
{
public DataFormLayoutManagerExt(SfDataForm dataForm) : base(dataForm)
{
}
protected override void OnEditorCreated(DataFormItem dataFormItem, View editor)
{
base.OnEditorCreated(dataFormItem, editor);
// Set editor IsVisible property to false to hide editor view.
if(dataFormItem.Name == "Details")
{
editor.IsVisible = false;
}
}
}
//Assign custom layout manager class to dataform layout manager.
dataForm.LayoutManager = new DataFormLayoutManagerExt(dataForm);
|
[C#]
public class DataFormNumericEditorExt : DataFormNumericEditor
{
public DataFormNumericEditorExt(SfDataForm dataForm) : base(dataForm)
{
}
}
public class DataFormMultilineEditorExt : DataFormMaskedEditTextEditor
{
public DataFormMultilineEditorExt(SfDataForm dataForm) : base(dataForm)
{
}
} |