Custom Control with Standard Properties
- Last UpdatedMar 12, 2021
- 1 minute read
You can create a custom control with a standard property.
The Data Lookup property can be used for consuming the Data Lookups
-
Create a custom control (Tree).
-
To use the DataLookupProperty as a property (Configuration Details) for the Tree View control, code in the Tree.cs control initialization file
as follows:
private DataLookupProperty dataLookupDetails = null;/// <summary>
/// Gets or Sets the configurationDetails property that holds lookup name and the parameter collection
/// </summary>
[DefaultValue(null)]
[DesignerProperty(775000, Categories.Behaviour,
[BindingAttribute(882700, "Skelta.Forms.Core.CommonObjects.DataLookupBindingProperty")]
public DataLookupProperty DataLookupDetails
{
get
{
return dataLookupDetails;
}
set
{
dataLookupDetails = value;
}
}
-
-
Build the custom control.
-
In Forms Designer, add the TreeView control to the form.
-
Modify the properties of the TreeView control as follows:
-
In the Basic tab, click the Data Source icon. The Lookup Source Configuration page appears.
-
In the Data Source Type drop-down, select a database.
-
In the Data Source drop-down, select a lookup.
-
Save the form.
-
-
Preview the form.
You can see the the data lookup name and the parameter collection in the preview.Note: The Tree control is available as a standard control in Forms. This example is given to demonstrate the use of DataLookupBindingProperty.